Converted A_Quake(Ex) intensity parameters from ints to doubles.

This commit is contained in:
Major Cooke 2022-12-25 16:14:57 -06:00 committed by Rachael Alexanderson
parent 9468ff85a2
commit aed72f58f3
7 changed files with 18 additions and 18 deletions

View file

@ -133,8 +133,8 @@ class DEarthquake : public DThinker
HAS_OBJECT_POINTERS HAS_OBJECT_POINTERS
public: public:
static const int DEFAULT_STAT = STAT_EARTHQUAKE; static const int DEFAULT_STAT = STAT_EARTHQUAKE;
void Construct(AActor *center, int intensityX, int intensityY, int intensityZ, int duration, void Construct(AActor *center, double intensityX, double intensityY, double intensityZ, int duration,
int damrad, int tremrad, FSoundID quakesfx, int flags, int damrad, int tremrad, FSoundID quakesfx, int flags,
double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint, double rollIntensity, double rollWave); double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint, double rollIntensity, double rollWave);
void Serialize(FSerializer &arc); void Serialize(FSerializer &arc);

View file

@ -48,7 +48,7 @@ IMPLEMENT_POINTERS_END
// //
//========================================================================== //==========================================================================
void DEarthquake::Construct(AActor *center, int intensityX, int intensityY, int intensityZ, int duration, void DEarthquake::Construct(AActor *center, double intensityX, double intensityY, double intensityZ, int duration,
int damrad, int tremrad, FSoundID quakesound, int flags, int damrad, int tremrad, FSoundID quakesound, int flags,
double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint, double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint,
double rollIntensity, double rollWave) double rollIntensity, double rollWave)
@ -408,7 +408,7 @@ int DEarthquake::StaticGetQuakeIntensities(double ticFrac, AActor *victim, FQuak
// //
//========================================================================== //==========================================================================
bool P_StartQuakeXYZ(FLevelLocals *Level, AActor *activator, int tid, int intensityX, int intensityY, int intensityZ, int duration, bool P_StartQuakeXYZ(FLevelLocals *Level, AActor *activator, int tid, double intensityX, double intensityY, double intensityZ, int duration,
int damrad, int tremrad, FSoundID quakesfx, int flags, int damrad, int tremrad, FSoundID quakesfx, int flags,
double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint, double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint,
double rollIntensity, double rollWave) double rollIntensity, double rollWave)
@ -416,9 +416,9 @@ bool P_StartQuakeXYZ(FLevelLocals *Level, AActor *activator, int tid, int intens
AActor *center; AActor *center;
bool res = false; bool res = false;
if (intensityX) intensityX = clamp(intensityX, 1, 9); intensityX = clamp<double>(intensityX, 0.0, 9.0);
if (intensityY) intensityY = clamp(intensityY, 1, 9); intensityY = clamp<double>(intensityY, 0.0, 9.0);
if (intensityZ) intensityZ = clamp(intensityZ, 1, 9); intensityZ = clamp<double>(intensityZ, 0.0, 9.0);
if (tid == 0) if (tid == 0)
{ {
@ -443,7 +443,7 @@ bool P_StartQuakeXYZ(FLevelLocals *Level, AActor *activator, int tid, int intens
return res; return res;
} }
bool P_StartQuake(FLevelLocals *Level, AActor *activator, int tid, int intensity, int duration, int damrad, int tremrad, FSoundID quakesfx) bool P_StartQuake(FLevelLocals *Level, AActor *activator, int tid, double intensity, int duration, int damrad, int tremrad, FSoundID quakesfx)
{ //Maintains original behavior by passing 0 to intensityZ, flags, and everything else after QSFX. { //Maintains original behavior by passing 0 to intensityZ, flags, and everything else after QSFX.
return P_StartQuakeXYZ(Level, activator, tid, intensity, intensity, 0, duration, damrad, tremrad, quakesfx, 0, 0, 0, 0, 0, 0, 0, 0); return P_StartQuakeXYZ(Level, activator, tid, intensity, intensity, 0, duration, damrad, tremrad, quakesfx, 0, 0, 0, 0, 0, 0, 0, 0);
} }

View file

@ -5624,7 +5624,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args)
} }
case ACSF_Radius_Quake2: case ACSF_Radius_Quake2:
P_StartQuake(Level, activator, args[0], args[1], args[2], args[3], args[4], S_FindSound(Level->Behaviors.LookupString(args[5]))); P_StartQuake(Level, activator, args[0], (double)args[1], args[2], args[3], args[4], S_FindSound(Level->Behaviors.LookupString(args[5])));
break; break;
case ACSF_CheckActorClass: case ACSF_CheckActorClass:

View file

@ -3333,7 +3333,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Teleport)
DEFINE_ACTION_FUNCTION(AActor, A_Quake) DEFINE_ACTION_FUNCTION(AActor, A_Quake)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT (intensity); PARAM_FLOAT (intensity);
PARAM_INT (duration); PARAM_INT (duration);
PARAM_INT (damrad); PARAM_INT (damrad);
PARAM_INT (tremrad); PARAM_INT (tremrad);
@ -3354,9 +3354,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Quake)
DEFINE_ACTION_FUNCTION(AActor, A_QuakeEx) DEFINE_ACTION_FUNCTION(AActor, A_QuakeEx)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(intensityX); PARAM_FLOAT(intensityX);
PARAM_INT(intensityY); PARAM_FLOAT(intensityY);
PARAM_INT(intensityZ); PARAM_FLOAT(intensityZ);
PARAM_INT(duration); PARAM_INT(duration);
PARAM_INT(damrad); PARAM_INT(damrad);
PARAM_INT(tremrad); PARAM_INT(tremrad);

View file

@ -2161,7 +2161,7 @@ FUNC(LS_Light_Stop)
FUNC(LS_Radius_Quake) FUNC(LS_Radius_Quake)
// Radius_Quake (intensity, duration, damrad, tremrad, tid) // Radius_Quake (intensity, duration, damrad, tremrad, tid)
{ {
return P_StartQuake (Level, it, arg4, arg0, arg1, arg2*64, arg3*64, S_FindSound("world/quake")); return P_StartQuake (Level, it, arg4, (double)arg0, arg1, arg2*64, arg3*64, S_FindSound("world/quake"));
} }
FUNC(LS_UsePuzzleItem) FUNC(LS_UsePuzzleItem)

View file

@ -164,7 +164,7 @@ void P_TerminateScript (FLevelLocals *Level, int script, const char *map);
// //
// [RH] p_quake.c // [RH] p_quake.c
// //
bool P_StartQuakeXYZ(FLevelLocals *Level, AActor *activator, int tid, int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad, FSoundID quakesfx, int flags, double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint, double rollIntensity, double rollWave); bool P_StartQuakeXYZ(FLevelLocals *Level, AActor *activator, int tid, double intensityX, double intensityY, double intensityZ, int duration, int damrad, int tremrad, FSoundID quakesfx, int flags, double waveSpeedX, double waveSpeedY, double waveSpeedZ, int falloff, int highpoint, double rollIntensity, double rollWave);
bool P_StartQuake(FLevelLocals *Level, AActor *activator, int tid, int intensity, int duration, int damrad, int tremrad, FSoundID quakesfx); bool P_StartQuake(FLevelLocals *Level, AActor *activator, int tid, double intensity, int duration, int damrad, int tremrad, FSoundID quakesfx);
#endif #endif

View file

@ -1208,8 +1208,8 @@ class Actor : Thinker native
deprecated("2.3", "User variables are deprecated in ZScript. Actor variables are directly accessible") native void A_SetUserArray(name varname, int index, int value); deprecated("2.3", "User variables are deprecated in ZScript. Actor variables are directly accessible") native void A_SetUserArray(name varname, int index, int value);
deprecated("2.3", "User variables are deprecated in ZScript. Actor variables are directly accessible") native void A_SetUserVarFloat(name varname, double value); deprecated("2.3", "User variables are deprecated in ZScript. Actor variables are directly accessible") native void A_SetUserVarFloat(name varname, double value);
deprecated("2.3", "User variables are deprecated in ZScript. Actor variables are directly accessible") native void A_SetUserArrayFloat(name varname, int index, double value); deprecated("2.3", "User variables are deprecated in ZScript. Actor variables are directly accessible") native void A_SetUserArrayFloat(name varname, int index, double value);
native void A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake"); native void A_Quake(double intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake");
native void A_QuakeEx(int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad, sound sfx = "world/quake", int flags = 0, double mulWaveX = 1, double mulWaveY = 1, double mulWaveZ = 1, int falloff = 0, int highpoint = 0, double rollIntensity = 0, double rollWave = 0); native void A_QuakeEx(double intensityX, double intensityY, double intensityZ, int duration, int damrad, int tremrad, sound sfx = "world/quake", int flags = 0, double mulWaveX = 1, double mulWaveY = 1, double mulWaveZ = 1, int falloff = 0, int highpoint = 0, double rollIntensity = 0, double rollWave = 0);
action native void A_SetTics(int tics); action native void A_SetTics(int tics);
native void A_DamageSelf(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT); native void A_DamageSelf(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
native void A_DamageTarget(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT); native void A_DamageTarget(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);