Thing_Remove in ZScript causes a crash

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!
User avatar
SPZ1
Posts: 375
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Thing_Remove in ZScript causes a crash

Post by SPZ1 »

I found that using Thing_Remove() in my ZScript causes a crash upon spawning an actor. I also found that Thing_Destroy() works properly. I made 2 demo files to demonstrate this. Simply type one of the following in the console in either file:

Code: Select all

summon SEC3
summon SEC4
summon SEC5
The Good Version

The Bad Version
Boondorl
Posts: 157
Joined: Wed Jul 11, 2018 10:57 pm

Re: Thing_Remove in ZScript causes a crash

Post by Boondorl »

I'm not sure why it aborts, but the logic is wrong here. You need to store snext before removing the Actor, otherwise the snext pointer will no longer valid by the time it sets it to the next one. It's possible something isn't getting cleaned up correctly which is why it's aborting since iirc it uses a debug value rather than truly setting it to null.

Return to “Bugs [GZDoom]”