[Not a bug] IsSaveGame works with EventHandler.

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

IsSaveGame works with EventHandler.

Postby Accensus » Thu Dec 30, 2021 6:07 am

...but only sometimes.

Test: https://drive.google.com/file/d/1T72EnO ... sp=sharing

1. Load Hideous Destructor. I know, I know, you don't have to actually play with it even for 2 seconds, it's just that this bug can't be reproduced without it being loaded for some reason.
2. Load AUGER;ZENITH.
3. use "map map16" (changemap also works; doesn't matter)
4. Save the game.
5. Load the save.
6. Console should print "lawl". It'll keep printing it each time you load the save.

Do the same but with map12 for example. No lawl is printed.
Accensus
 
Joined: 11 Feb 2016

Re: IsSaveGame works with EventHandler.

Postby Marisa Kirisame » Thu Dec 30, 2021 8:02 am

IsSaveGame is only guaranteed to work in static handlers. I'm pretty sure this is by design, considering normal handlers are part of the map itself and get serialized/deserialized like any other map object.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: IsSaveGame works with EventHandler.

Postby Accensus » Thu Dec 30, 2021 8:07 am

Yeah. Except it still does, even with EventHandler, hence the report in the first place. And it only works on this particular map with this particular mod for ???? reason. I discovered this chasing a VM abort where a reference was nulled as part of a DestroyAllThinkers routine during save game loading. That issue also happened only on that specific map and only once per engine load, afterwards loading the save resulted in "Unloading scripts cannot exit the level again."

Unless I'm misunderstanding your post and IsSaveGame working with EventHandler is not a bug, just not something you can rely on.
Accensus
 
Joined: 11 Feb 2016

Re: IsSaveGame works with EventHandler.

Postby Graf Zahl » Thu Dec 30, 2021 11:05 am

Your event handler is not static. What you run into here is plain and simply undefined behavior.
The WorldUnloaded event is called from different places for static and non-static event handlers so whatever you get is not guaranteed.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 2 guests