[MIRROR] Fixes a bunch of AI related CI runtimes #1071
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mirrored on Skyrat: Skyrat-SS13/Skyrat-tg#25552
Original PR: tgstation/tgstation#80202
About The Pull Request
A bunch of the numerous CI issues
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 thepawn
var has become null from qdeletion. Many of theSelectBehaviors()
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 onSelectBehaviors()
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
🆑 vinylspiders
fix: fixes some AI runtimes that were caused by the pawn becoming null
/:cl: