SpawnBlood now returns an actor spawned by the function.

This commit is contained in:
MajorCooke 2025-04-23 12:12:06 -05:00 committed by Ricardo Luís Vaz Silva
commit 6c4afed100
3 changed files with 7 additions and 6 deletions

View file

@ -106,7 +106,7 @@ enum EPuffFlags
};
AActor *P_SpawnPuff(AActor *source, PClassActor *pufftype, const DVector3 &pos, DAngle hitdir, DAngle particledir, int updown, int flags = 0, AActor *vict = NULL);
void P_SpawnBlood (const DVector3 &pos, DAngle angle, int damage, AActor *originator);
AActor *P_SpawnBlood (const DVector3 &pos, DAngle angle, int damage, AActor *originator);
void P_BloodSplatter (const DVector3 &pos, AActor *originator, DAngle hitangle);
void P_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle);
void P_RipperBlood (AActor *mo, AActor *bleeder);

View file

@ -6771,9 +6771,9 @@ DEFINE_ACTION_FUNCTION(AActor, SpawnPuff)
//
//---------------------------------------------------------------------------
void P_SpawnBlood (const DVector3 &pos1, DAngle dir, int damage, AActor *originator)
AActor *P_SpawnBlood (const DVector3 &pos1, DAngle dir, int damage, AActor *originator)
{
AActor *th;
AActor *th = nullptr;
PClassActor *bloodcls = originator->GetBloodType();
DVector3 pos = pos1;
pos.Z += pr_spawnblood.Random2() / 64.;
@ -6858,6 +6858,8 @@ void P_SpawnBlood (const DVector3 &pos1, DAngle dir, int damage, AActor *origina
if (bloodtype >= 1)
P_DrawSplash2 (originator->Level, 40, pos, dir, 2, originator->BloodColor);
return th;
}
DEFINE_ACTION_FUNCTION(AActor, SpawnBlood)
@ -6868,8 +6870,7 @@ DEFINE_ACTION_FUNCTION(AActor, SpawnBlood)
PARAM_FLOAT(z);
PARAM_ANGLE(dir);
PARAM_INT(damage);
P_SpawnBlood(DVector3(x, y, z), dir, damage, self);
return 0;
ACTION_RETURN_OBJECT(P_SpawnBlood(DVector3(x, y, z), dir, damage, self));
}

View file

@ -809,7 +809,7 @@ class Actor : Thinker native
native Actor OldSpawnMissile(Actor dest, class<Actor> type, Actor owner = null);
native Actor SpawnPuff(class<Actor> pufftype, vector3 pos, double hitdir, double particledir, int updown, int flags = 0, Actor victim = null);
native void SpawnBlood (Vector3 pos1, double dir, int damage);
native Actor SpawnBlood (Vector3 pos1, double dir, int damage);
native void BloodSplatter (Vector3 pos, double hitangle, bool axe = false);
native bool HitWater (sector sec, Vector3 pos, bool checkabove = false, bool alert = true, bool force = false, int flags = 0);
native void PlaySpawnSound(Actor missile);