From 0e9ca3c850668441b1175955e2c8570802bc2d22 Mon Sep 17 00:00:00 2001 From: Mekboss Date: Mon, 30 Mar 2020 18:52:27 +0300 Subject: [PATCH] Replace function variables to DVector3 --- src/playsim/a_decals.cpp | 6 +++--- src/playsim/a_sharedglobal.h | 2 +- src/playsim/p_actionfunctions.cpp | 2 +- wadsrc/static/zscript/actors/actor.zs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/playsim/a_decals.cpp b/src/playsim/a_decals.cpp index 1eb5a588e2..03fd79ebd7 100644 --- a/src/playsim/a_decals.cpp +++ b/src/playsim/a_decals.cpp @@ -830,14 +830,14 @@ DBaseDecal *DImpactDecal::CloneSelf (const FDecalTemplate *tpl, double ix, doubl // //---------------------------------------------------------------------------- -void SprayDecal(AActor *shooter, const char *name, double distance, double DirX, double DirY, double DirZ) +void SprayDecal(AActor *shooter, const char *name, double distance, DVector3 Dir) { FTraceResults trace; DVector3 vec; //use new behavior only if directional vector not equal to zero vector - if (DirX != 0 || DirY != 0 || DirZ != 0) + if (!Dir.isZero() ) { - vec = DVector3(DirX, DirY, DirZ); + vec = Dir; } else diff --git a/src/playsim/a_sharedglobal.h b/src/playsim/a_sharedglobal.h index 1246255ea7..0ca4673b9d 100644 --- a/src/playsim/a_sharedglobal.h +++ b/src/playsim/a_sharedglobal.h @@ -12,7 +12,7 @@ class DBaseDecal; struct SpreadInfo; DBaseDecal *ShootDecal(FLevelLocals *Level, const FDecalTemplate *tpl, sector_t *sec, double x, double y, double z, DAngle angle, double tracedist, bool permanent); -void SprayDecal(AActor *shooter, const char *name,double distance = 172., double DirX = 0., double DirY = 0., double DirZ = 0.); +void SprayDecal(AActor *shooter, const char *name,double distance = 172., DVector3 Dir = (0, 0, 0) ); class DBaseDecal : public DThinker { diff --git a/src/playsim/p_actionfunctions.cpp b/src/playsim/p_actionfunctions.cpp index 047aed2a50..c1a2015afb 100644 --- a/src/playsim/p_actionfunctions.cpp +++ b/src/playsim/p_actionfunctions.cpp @@ -4920,7 +4920,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SprayDecal) PARAM_FLOAT(DirX); PARAM_FLOAT(DirY); PARAM_FLOAT(DirZ); - SprayDecal(self, name, dist, DirX, DirY, DirZ); + SprayDecal(self, name, dist, DVector3(DirX, DirY, DirZ) ); return 0; } diff --git a/wadsrc/static/zscript/actors/actor.zs b/wadsrc/static/zscript/actors/actor.zs index 28dd0b2953..02aaab2052 100644 --- a/wadsrc/static/zscript/actors/actor.zs +++ b/wadsrc/static/zscript/actors/actor.zs @@ -1157,7 +1157,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 = -1, double newheight = -1, bool testpos = false); - native void A_SprayDecal(String name, double dist = 172, double DirX = 0, double DirY = 0, double DirZ = 0); + native void A_SprayDecal(String name, double dist = 172, vector3 Dir = (0, 0, 0) ); native void A_SetMugshotState(String name); native void CopyBloodColor(Actor other);