Fixed applying of multiple damage factors

https://mantis.zdoom.org/view.php?id=586
This commit is contained in:
alexey.lysiuk 2017-04-15 12:33:26 +03:00
parent 0ebf4958b9
commit 490fd8f3a0
1 changed files with 5 additions and 2 deletions

View File

@ -513,8 +513,11 @@ void PClassActor::SetDamageFactor(FName type, double factor)
{ {
for (auto & p : ActorInfo()->DamageFactors) for (auto & p : ActorInfo()->DamageFactors)
{ {
if (p.first == type) p.second = factor; if (p.first == type)
return; {
p.second = factor;
return;
}
} }
ActorInfo()->DamageFactors.Push({ type, factor }); ActorInfo()->DamageFactors.Push({ type, factor });
} }