diff --git a/src/g_shared/a_decals.cpp b/src/g_shared/a_decals.cpp index 3840a9af9..edc170294 100644 --- a/src/g_shared/a_decals.cpp +++ b/src/g_shared/a_decals.cpp @@ -704,7 +704,7 @@ CCMD (spray) Net_WriteString (argv[1]); } -void SprayDecal(AActor *shooter, const char *name) +void SprayDecal(AActor *shooter, const char *name, double distance) { FTraceResults trace; @@ -713,7 +713,7 @@ void SprayDecal(AActor *shooter, const char *name) double c = pitch.Cos(); DVector3 vec(c * ang.Cos(), c * ang.Sin(), -pitch.Sin()); - if (Trace(shooter->PosPlusZ(shooter->Height / 2), shooter->Sector, vec, 172., 0, ML_BLOCKEVERYTHING, shooter, trace, TRACE_NoSky)) + if (Trace(shooter->PosPlusZ(shooter->Height / 2), shooter->Sector, vec, distance, 0, ML_BLOCKEVERYTHING, shooter, trace, TRACE_NoSky)) { if (trace.HitType == TRACE_HitWall) { diff --git a/src/g_shared/a_sharedglobal.h b/src/g_shared/a_sharedglobal.h index f45cd9d0e..626985f93 100644 --- a/src/g_shared/a_sharedglobal.h +++ b/src/g_shared/a_sharedglobal.h @@ -11,7 +11,7 @@ struct F3DFloor; class DBaseDecal; class DBaseDecal *ShootDecal(const FDecalTemplate *tpl, AActor *basisactor, sector_t *sec, double x, double y, double z, DAngle angle, double tracedist, bool permanent); -void SprayDecal(AActor *shooter, const char *name); +void SprayDecal(AActor *shooter, const char *name,double distance = 172.); class DBaseDecal : public DThinker { diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 0387bfd52..838c885e6 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -6813,7 +6813,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SprayDecal) { PARAM_SELF_PROLOGUE(AActor); PARAM_STRING(name); - SprayDecal(self, name); + PARAM_FLOAT_DEF(dist); + SprayDecal(self, name, dist); return 0; } diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index fb883f846..9b7836d17 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -1092,7 +1092,7 @@ class Actor : Thinker native native bool A_SetVisibleRotation(double anglestart = 0, double angleend = 0, double pitchstart = 0, double pitchend = 0, int flags = 0, int ptr = AAPTR_DEFAULT); native void A_SetTranslation(name transname); native bool A_SetSize(double newradius, double newheight = -1, bool testpos = false); - native void A_SprayDecal(String name); + native void A_SprayDecal(String name, double dist = 172); native void A_SetMugshotState(String name); native void A_RearrangePointers(int newtarget, int newmaster = AAPTR_DEFAULT, int newtracer = AAPTR_DEFAULT, int flags=0);