mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 15:52:09 +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);
|
P_PlaySpawnSound(th, source);
|
||||||
|
|
||||||
// record missile's originator
|
// record missile's originator
|
||||||
if (owner) th->target = owner;
|
if (owner == NULL) owner = source;
|
||||||
else th->target = source;
|
th->target = owner;
|
||||||
|
|
||||||
float speed = (float)(th->Speed);
|
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);
|
mo = Spawn (type, source->x, source->y, z, ALLOW_REPLACE);
|
||||||
|
|
||||||
P_PlaySpawnSound(mo, source);
|
P_PlaySpawnSound(mo, source);
|
||||||
mo->target = owner != NULL ? owner : source; // Originator
|
if (owner == NULL) owner = source;
|
||||||
|
mo->target = owner;
|
||||||
mo->angle = angle;
|
mo->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
mo->velx = FixedMul (speed, finecosine[angle]);
|
mo->velx = FixedMul (speed, finecosine[angle]);
|
||||||
|
|
Loading…
Reference in a new issue