Fix crash when calling TF2_IsHolidayActive while no map is running#1694
Fix crash when calling TF2_IsHolidayActive while no map is running#1694Mikusch wants to merge 1 commit intoalliedmodders:masterfrom
Conversation
|
Is there a more concrete thing we can check here that is actually related to the crash? E.g. is it actually that the gamerules ptr is invalid between maps and sdktools should be clearing it out? |
Looking in IDA I think that the gamerules pointer doesnt get set until CWorld::Precache is called (CWorld::Precache -> InstallGameRules -> CreateGameRulesObject), which I think only happens if a map is loaded, unless I'm misunderstanding what CWorld is. |
|
You should also add the errors to the docstring in tf2.inc |
|
Is there a stack from a Linux box or similar for this one? Asher is right if the ptr is invalid at a global level we should correct that instead. |
I let the server start up (on itemtest), then did
and it crashed. |
|
TF2 uses the That |
|
Thanks for the input. I'll create a new PR that fixes this issue in a more concrete way. |
Currently, the server crashes when attempting to call
TF2_IsHolidayActivewhile no map is running. Throw a native error instead.Can be tested with this snippet: