IsSaveGame works with EventHandler.

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Accensus
Banned User
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

IsSaveGame works with EventHandler.

Post by Accensus »

...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.
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: IsSaveGame works with EventHandler.

Post by Marisa the Magician »

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
Accensus
Banned User
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Re: IsSaveGame works with EventHandler.

Post by Accensus »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: IsSaveGame works with EventHandler.

Post by Graf Zahl »

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.
Post Reply

Return to “Closed Bugs [GZDoom]”