[Closed] PostBeginPlay erroneously called upon loading a save

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

PostBeginPlay erroneously called upon loading a save

Postby Player701 » Fri Jan 18, 2019 2:09 pm

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 allExpand view
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 4 times
User avatar
Player701
You are now breathing manually.
 
Joined: 13 May 2009
Location: Russian Federation
Discord: Player701#8214

Re: PostBeginPlay erroneously called upon loading a save

Postby Player701 » Sat Jan 26, 2019 10:25 am

I guess this was closed due to the recent rollback. Can confirm this bug does not occur in the latest master.
User avatar
Player701
You are now breathing manually.
 
Joined: 13 May 2009
Location: Russian Federation
Discord: Player701#8214


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests