-let A_FireProjectile pass through the second return value of SpawnPlayerMissile.

This commit is contained in:
Christoph Oelckers 2022-07-14 07:59:52 +02:00
parent e1c458ab2f
commit a952d0f36a
1 changed files with 9 additions and 6 deletions

View File

@ -207,7 +207,7 @@ class StateProvider : Inventory
//
//==========================================================================
action Actor A_FireProjectile(class<Actor> missiletype, double angle = 0, bool useammo = true, double spawnofs_xy = 0, double spawnheight = 0, int flags = 0, double pitch = 0)
action Actor, Actor A_FireProjectile(class<Actor> missiletype, double angle = 0, bool useammo = true, double spawnofs_xy = 0, double spawnheight = 0, int flags = 0, double pitch = 0)
{
let player = self.player;
if (!player) return null;
@ -234,14 +234,17 @@ class StateProvider : Inventory
// Temporarily adjusts the pitch
double saved_player_pitch = self.Pitch;
self.Pitch += pitch;
let misl = SpawnPlayerMissile (missiletype, shootangle, ofs.X, ofs.Y, spawnheight, t, false, (flags & FPF_NOAUTOAIM) != 0);
Actor misl, realmisl;
[misl, realmisl] = SpawnPlayerMissile (missiletype, shootangle, ofs.X, ofs.Y, spawnheight, t, false, (flags & FPF_NOAUTOAIM) != 0);
self.Pitch = saved_player_pitch;
if (realmisl && flags & FPF_TRANSFERTRANSLATION)
realmisl.Translation = Translation;
// automatic handling of seeker missiles
if (misl)
{
if (flags & FPF_TRANSFERTRANSLATION)
misl.Translation = Translation;
if (t.linetarget && !t.unlinked && misl.bSeekerMissile)
misl.tracer = t.linetarget;
if (!(flags & FPF_AIMATANGLE))
@ -252,9 +255,9 @@ class StateProvider : Inventory
misl.VelFromAngle(misl.Vel.XY.Length());
}
}
return misl;
return misl, realmisl;
}
return null;
return null, null;
}
//==========================================================================