Fixed applying of multiple pain chances

https://mantis.zdoom.org/view.php?id=608
This commit is contained in:
alexey.lysiuk 2017-04-20 22:09:18 +03:00
parent e19f6fe8ea
commit c681d6eff0

View file

@ -532,8 +532,11 @@ void PClassActor::SetPainChance(FName type, int chance)
{ {
for (auto & p : ActorInfo()->PainChances) for (auto & p : ActorInfo()->PainChances)
{ {
if (p.first == type) p.second = chance; if (p.first == type)
return; {
p.second = chance;
return;
}
} }
if (chance >= 0) if (chance >= 0)