- added a distance parameter to A_SprayDecal.

This commit is contained in:
Christoph Oelckers 2017-04-14 16:28:54 +02:00
parent 92acbdc625
commit 329c168cc2
4 changed files with 6 additions and 5 deletions

View file

@ -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)
{

View file

@ -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
{

View file

@ -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;
}

View file

@ -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);