Same mod as before. Turn on the flashlight, save the game, then load the game. The spotlight would disappear.
https://www.dropbox.com/s/vbwsji4l6e85m ... 0.pk7?dl=1
gf10ded756 dynamic light disappears when you load a save
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.
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.
- Player701
-
- Posts: 1640
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: gf10ded756 dynamic light disappears when you load a save
When a save game is loaded, dynamic light actors have lights reattached to them, but these lights are not reactivated. That's why the light disappears.
An obvious solution would be to check if the dynamic light actor has the DORMANT flag unset and activate the light in this case. However, this flag can be changed on the script side at any time, so it's not foolproof.
Edit: It seems that RecreateAllAttachedLights is called not only when the game is loaded, but also when it is saved. I'm not sure if I understand the need for this, so I won't provide a PR here. The cause of the problem is more or less evident, anyway.
An obvious solution would be to check if the dynamic light actor has the DORMANT flag unset and activate the light in this case. However, this flag can be changed on the script side at any time, so it's not foolproof.
Edit: It seems that RecreateAllAttachedLights is called not only when the game is loaded, but also when it is saved. I'm not sure if I understand the need for this, so I won't provide a PR here. The cause of the problem is more or less evident, anyway.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: gf10ded756 dynamic light disappears when you load a save
same as the other one.
- Player701
-
- Posts: 1640
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: gf10ded756 dynamic light disappears when you load a save
This fix (as of g3.8pre-180-ga2065cae4) creates the following problem with the example WAD (steve_flashlight_2018.02.10.pk7 from the OP): after toggling the flashlight once, saving the game will create another copy of the light in the same place where the light actor was last positioned. Saving the game repeatedly seems to create more and more lights, ad infinitum. Turning the flashlight on again will make all these lights move together as one. Loading the saved game will make all lights but one go away; one light always remains regardless of whether the flashlight was turned on or off when the game was saved.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49073
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: gf10ded756 dynamic light disappears when you load a save
please report this as a new bug!