From 6f25f665b24c9eae480c09cfb4dd504fce2793e8 Mon Sep 17 00:00:00 2001 From: qndel Date: Sat, 23 Oct 2021 12:50:37 +0200 Subject: [PATCH] fix barbarian armor pierce --- Source/player.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Source/player.h b/Source/player.h index affe22d92..85f7f40fe 100644 --- a/Source/player.h +++ b/Source/player.h @@ -492,15 +492,17 @@ struct Player { int CalculateArmorPierce(int monsterArmor, bool isMelee) const { int tmac = monsterArmor; - if (gbIsHellfire && _pIEnAc > 0) { - int pIEnAc = _pIEnAc - 1; - if (pIEnAc > 0) - tmac >>= pIEnAc; - else - tmac -= tmac / 4; - } - if (isMelee && _pClass == HeroClass::Barbarian) { - tmac -= monsterArmor / 8; + if (_pIEnAc > 0) { + if (gbIsHellfire) { + int pIEnAc = _pIEnAc - 1; + if (pIEnAc > 0) + tmac >>= pIEnAc; + else + tmac -= tmac / 4; + } + if (isMelee && _pClass == HeroClass::Barbarian) { + tmac -= monsterArmor / 8; + } } if (tmac < 0) tmac = 0;