-
Notifications
You must be signed in to change notification settings - Fork 74
[GEN][ZH] Fix crash upon beacon removal in GameLogic::logicMessageDispatcher #1065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[GEN][ZH] Fix crash upon beacon removal in GameLogic::logicMessageDispatcher #1065
Conversation
Looks similar to #972 So only |
Yes, that would be enough to fix this particular crash. I won't pretend to have much insight which pointers can or cannot be nullptrs in this code base. Here's a place where they're also checked: GeneralsGameCode/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp Lines 1767 to 1772 in d92834c
|
This issue is likely similar to the AiCommand issue i had with Hackers. In this instance the original player may have been deleted before the command is acted upon. |
This looks very similar to #987. |
Can you try figure out the reason for the null template? Maybe there is something that needs to be fixed higher up. Other than that, it would be good to only change what is necessary to fix this crash. If another pointer would cause crashing with a different repro, then that warrants another investigation independent of this one. |
GeneralsGameCode/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
Lines 1701 to 1716 in d92834c
There's no sanity check for
beacon->getControllingPlayer()->getPlayerTemplate()
which causes a crash if the template is a nullptr. I wasn't able to find out much about why this happens, though I did notice that the controlling player was marked asPLAYER_COMPUTER
.The game no longer crashes with this PR.