A_FireProjectile returns null sometimes.

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Accensus
Banned User
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

A_FireProjectile returns null sometimes.

Post by Accensus »

This happens if it's used at point-blank range and the projectile explodes immediately. The projectile itself does not have a zero tic duration Death state. I have narrowed it down to this line. This most definitely seems intentional, but I can't figure out the reasoning for not returning a pointer to the projectile if it explodes immediately, provided it exists for a few tics after death. In my case I store some important data on the projectile when it is spawned, but cannot store it if the pointer to it is null on spawn.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_FireProjectile returns null sometimes.

Post by Graf Zahl »

That's what the second return value of SpawnPlayerMissile is there for. The behavior is by design. This happens if the projectile gets destroyed right away, you have to check this case in your code.
User avatar
Accensus
Banned User
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Re: A_FireProjectile returns null sometimes.

Post by Accensus »

I'll fix it on my end then. Thank you.
Post Reply

Return to “Closed Bugs [GZDoom]”