mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-12 01:43:40 +00:00
* Fixes a bunch of AI related CI runtimes (#80202) ## About The Pull Request <details><summary>A bunch of the numerous CI issues </summary>   </details> You can view the full list of them here https://github.com/Skyrat-SS13/Skyrat-tg/actions/runs/7148986054/job/19470671408. What seems to be happening is, the `ai_controller` `fire()`s, and at some point the the `pawn` var has become null from qdeletion. Many of the `SelectBehaviors()` procs make use of that var, and then try to access it without any safeties whatsoever. I believe it is mainly happening because of long `do_after()`s and other procs that sleep. This PR just adds those safeties. I probably didn't get them all, but this should fix the ones I have seen in CI. There may be a better solution to cover all future cases of this but I will wait on feedback to proceed. See below comments: --- I don't know if you would rather this to always be checked at the controller level instead (or in `able_to_plan()` perhaps?) but I could do that if it's wanted. I wasn't sure if there were certain things that depended on `SelectBehaviors()` running for cleanup so I opted against that. On that note, shouldn't we just be qdeleting the `ai_controller` when the pawn gets qdeleted? Is that not already happening? And if not, is there a reason for it? That would probably be the best way to handle it... ## Why It's Good For The Game I would like to stop seeing so many random CI failures, wouldn't you? ## Changelog 🆑 fix: fixes some AI runtimes that were caused by the pawn becoming null /🆑 * Fixes a bunch of AI related CI runtimes --------- Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>