From 2cf3b20ea8c4850621d81bdf9e0e0d88c3fd3a1d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 25 Mar 2016 16:30:31 +0100 Subject: [PATCH] - floatified the last remaining AActor member variable 'damagemultiply'. --- src/actor.h | 2 +- src/p_acs.cpp | 4 ++-- src/p_interaction.cpp | 2 +- src/p_mobj.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/actor.h b/src/actor.h index 5d3e85bc8d..aa5e484294 100644 --- a/src/actor.h +++ b/src/actor.h @@ -1290,7 +1290,7 @@ public: FNameNoInit DamageType; FNameNoInit DamageTypeReceived; double DamageFactor; - fixed_t DamageMultiply; + double DamageMultiply; FNameNoInit PainType; FNameNoInit DeathType; diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 1f28ed6361..3ea923542a 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -3964,7 +3964,7 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value) break; case APROP_DamageMultiplier: - actor->DamageMultiply = value; + actor->DamageMultiply = ACSToDouble(value); break; case APROP_MasterTID: @@ -4044,7 +4044,7 @@ int DLevelScript::GetActorProperty (int tid, int property) case APROP_Speed: return DoubleToACS(actor->Speed); case APROP_Damage: return actor->GetMissileDamage(0,1); case APROP_DamageFactor:return DoubleToACS(actor->DamageFactor); - case APROP_DamageMultiplier: return actor->DamageMultiply; + case APROP_DamageMultiplier: return DoubleToACS(actor->DamageMultiply); case APROP_Alpha: return DoubleToACS(actor->Alpha); case APROP_RenderStyle: for (int style = STYLE_None; style < STYLE_Count; ++style) { // Check for a legacy render style that matches. diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 6d047e6f38..35209a9f9e 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1076,7 +1076,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, if (damage > 0 && source != NULL) { - damage = FixedMul(damage, source->DamageMultiply); + damage = int(damage * source->DamageMultiply); // Handle active damage modifiers (e.g. PowerDamage) if (damage > 0 && source->Inventory != NULL) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 8b6c3f4ad7..478ec3a9e4 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -410,7 +410,7 @@ void AActor::Serialize(FArchive &arc) } else { - DamageMultiply = FRACUNIT; + DamageMultiply = 1.; } arc << WeaveIndexXY << WeaveIndexZ << PoisonDamageReceived << PoisonDurationReceived << PoisonPeriodReceived << Poisoner @@ -4180,7 +4180,7 @@ AActor *AActor::StaticSpawn (PClassActor *type, const DVector3 &pos, replace_t a actor->touching_sectorlist = NULL; // NULL head of sector list // phares 3/13/98 if (G_SkillProperty(SKILLP_FastMonsters) && actor->GetClass()->FastSpeed >= 0) actor->Speed = actor->GetClass()->FastSpeed; - actor->DamageMultiply = FRACUNIT; + actor->DamageMultiply = 1.; // set subsector and/or block links actor->LinkToWorld (SpawningMapThing);