OnRegister triggered twice when returning to map in hub

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

OnRegister triggered twice when returning to map in hub

Postby gwHero » Tue Aug 28, 2018 3:32 am


I noticed that OnRegister (ZScript) is called twice for an event class when the player returns to a map in a hub.
I have included a small demo pk3 with 2 maps; just walk to the exit signs and check the console; you will see that OnRegister is called once when a map is entered for the the first time, but on return it's always called twice.

Some remarks:
- I discovered this with the latest version 3.5.1, but it seems to exist for quite some time (tested back as far as 3.2.4 and it also already happened there);
- it doesn't make any difference if the events are defined with AddEventHandlers on game level or with EventHandlers on map level (see MAPINFO)

You do not have the required permissions to view the files attached to this post.
User avatar
Be your own Siddhartha
Joined: 08 May 2017
Location: The Netherlands
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: Intel with Vulkan Support

Re: OnRegister triggered twice when returning to map in hub

Postby Graf Zahl » Tue Aug 28, 2018 4:54 am

This is a bit of a problem, because there's actually two players entering a map during a hub transition. One is a temporary placeholder, coming from the savegame, the other one the real player coming from the previous map and this gets called for both.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Joined: 19 Jul 2003
Location: Germany

Return to Bugs

Who is online

Users browsing this forum: djreksian and 0 guests