mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- ensure that the 'owner' variable in the missile spawning functions is always valid.
SVN r3660 (trunk)
This commit is contained in:
parent
625ee246d7
commit
0cc6822a11
1 changed files with 4 additions and 3 deletions
|
@ -5253,8 +5253,8 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
|||
P_PlaySpawnSound(th, source);
|
||||
|
||||
// record missile's originator
|
||||
if (owner) th->target = owner;
|
||||
else th->target = source;
|
||||
if (owner == NULL) owner = source;
|
||||
th->target = owner;
|
||||
|
||||
float speed = (float)(th->Speed);
|
||||
|
||||
|
@ -5420,7 +5420,8 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
|||
mo = Spawn (type, source->x, source->y, z, ALLOW_REPLACE);
|
||||
|
||||
P_PlaySpawnSound(mo, source);
|
||||
mo->target = owner != NULL ? owner : source; // Originator
|
||||
if (owner == NULL) owner = source;
|
||||
mo->target = owner;
|
||||
mo->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
mo->velx = FixedMul (speed, finecosine[angle]);
|
||||
|
|
Loading…
Reference in a new issue