[Fixed] RandomSpawner spawning a RandomSpawner spawning a missile

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

RandomSpawner spawning a RandomSpawner spawning a missile

Postby Player701 » Mon Nov 30, 2020 2:32 pm

When a RandomSpawner attempts to spawn another RandomSpawner which in turn decides to spawn a missile, weird things may happen. This is because the first RandomSpawner will call CheckMissileSpawn for the second RandomSpawner, causing the engine to attempt to treat that spawner as if it were an actual missile. At the very least, this results in wrong dimensions being used to measure if the object fits within the area at the spawn coordinates, and the resulting RandomSpawner may get destroyed by P_ExplodeMissile before the real missile can even appear. See here for a detailed breakdown of events that happen in this scenario.

The suggested resolution is to add another check before calling CheckMissileSpawn to make sure the spawned actor is not another RandomSpawner. My post in Scripting also mentions this code block, but looking at it again I think I've been mistaken about it, and that part does not require any fixing (since the MISSILE flag will only appear on the RandomSpawner itself when it's set in the defaults of the actor class it has chosen to spawn, which can only happen with actual missiles).
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: RandomSpawner spawning a RandomSpawner spawning a missil

Postby Player701 » Wed Dec 02, 2020 7:03 am

Since this hasn't been closed as "don't do that" / "user error", I'm proposing a PR to fix this bug.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests