In custom ZScript code, it's practically become a regular thing that every single call to DamageMobj needs a null check afterwards because some actors will simply stop existing and become null immediately as they have no Death state defined. Some people don't know this, and it ends up causing VM aborts, and it has to be patched up. Besides, something like this makes it difficult to perform other operations afterwards, such as spawning/tracing blood from the actor after it takes damage.
I don't understand why the base Actor class can't just have a simple Death state that's a single TNT1 A 1. Would that cause some sort of problem?
Please give actors a default Death state
Moderator: GZDoom Developers
-
-
- Posts: 3878
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
-
- Lead GZDoom+Raze Developer
- Posts: 48534
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Please give actors a default Death state
A default death state cannot be added because some features check the presence of the state. What could be done is to switch to a dummy state if a null state would be set otherwise.