From 0ca693771be03cdbd6ed8315faec221052fa3783 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 22 Mar 2010 21:18:54 +0000 Subject: [PATCH] - Keep all damage factors in the table, even those that are 1.0. - 256 is a valid pain chance, so clamp to that, not 255. SVN r2237 (trunk) --- src/info.cpp | 13 ++++--------- src/info.h | 2 +- src/p_interaction.cpp | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/info.cpp b/src/info.cpp index c3e5ac63e..1006f2b9c 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -273,16 +273,11 @@ FActorInfo *FActorInfo::GetReplacee (bool lookskill) void FActorInfo::SetDamageFactor(FName type, fixed_t factor) { - if (factor != FRACUNIT) + if (DamageFactors == NULL) { - if (DamageFactors == NULL) DamageFactors=new DmgFactors; - DamageFactors->Insert(type, factor); - } - else - { - if (DamageFactors != NULL) - DamageFactors->Remove(type); + DamageFactors = new DmgFactors; } + DamageFactors->Insert(type, factor); } //========================================================================== @@ -295,7 +290,7 @@ void FActorInfo::SetPainChance(FName type, int chance) if (chance >= 0) { if (PainChances == NULL) PainChances=new PainChanceList; - PainChances->Insert(type, MIN(chance, 255)); + PainChances->Insert(type, MIN(chance, 256)); } else { diff --git a/src/info.h b/src/info.h index 82de9486c..034c63196 100644 --- a/src/info.h +++ b/src/info.h @@ -158,7 +158,7 @@ struct FPlayerColorSet }; typedef TMap DmgFactors; -typedef TMap PainChanceList; +typedef TMap PainChanceList; typedef TMap FPlayerColorSetMap; struct FActorInfo diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 24d6cfd83..6cdf86ab5 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1285,7 +1285,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage painchance = target->PainChance; if (pc != NULL) { - BYTE * ppc = pc->CheckKey(mod); + int *ppc = pc->CheckKey(mod); if (ppc != NULL) { painchance = *ppc;