PostBeginPlay erroneously called upon loading a save

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
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

PostBeginPlay erroneously called upon loading a save

Post by Player701 »

When a save game is loaded, PostBeginPlay will be called for all actors present in the map. This is probably unintended, since PostBeginPlay usually performs first-time initialization, and calling it more than once can lead to unexpected behavior. It used to work correctly until one of these three commits. (the exact one cannot be determined because some of them cannot be checked due to errors / crashes)

Here's a script to reproduce this bug easily (also attached to this report):

Code: Select all

class TestZombie : ZombieMan replaces ZombieMan
{
    Default
    {
        RenderStyle "Translucent";
    }
    
    override void PostBeginPlay()
    {
        Super.PostBeginPlay();
        Console.Printf("TestZombie::PostBeginPlay");
        Alpha = 0.1;
    }
    
    override void Tick()
    {
        Super.Tick();
        
        if (Alpha < 1)
        {
            Alpha += 0.01;
        }
    }
}
At the start of the game, all zombies are initially translucent, but they will soon turn opaque. Saving and reloading the game, however, will make them translucent again. This didn't happen in older versions. Note that this bug is also reproducible when revisiting a map within a hub.

Upd: Here is another proof that the current behavior is wrong: if a SecretTrigger actor is placed in a map, it will increase the total number of secrets with each subsequent save-load cycle. This is definitely not how it's supposed to work...
Attachments
zscript.txt
(434 Bytes) Downloaded 23 times
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: PostBeginPlay erroneously called upon loading a save

Post by Player701 »

I guess this was closed due to the recent rollback. Can confirm this bug does not occur in the latest master.
Post Reply

Return to “Closed Bugs [GZDoom]”