diff --git a/src/playsim/p_local.h b/src/playsim/p_local.h index 584cfc43f..6575ad3e5 100644 --- a/src/playsim/p_local.h +++ b/src/playsim/p_local.h @@ -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); diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 3db0e3506..46728cea0 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -6382,9 +6382,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.; @@ -6469,6 +6469,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) @@ -6479,8 +6481,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)); } diff --git a/wadsrc/static/zscript/actors/actor.zs b/wadsrc/static/zscript/actors/actor.zs index a809e674d..a34319524 100644 --- a/wadsrc/static/zscript/actors/actor.zs +++ b/wadsrc/static/zscript/actors/actor.zs @@ -775,7 +775,7 @@ class Actor : Thinker native native Actor OldSpawnMissile(Actor dest, class type, Actor owner = null); native Actor SpawnPuff(class 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);