From d7966cdab2de4e5bd461fa5886740cab8eb08d90 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 6 Aug 2022 20:05:33 +0300 Subject: [PATCH] Fix updating armor class --- src/interpreter_extra.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/interpreter_extra.cc b/src/interpreter_extra.cc index e545f39..958a9fd 100644 --- a/src/interpreter_extra.cc +++ b/src/interpreter_extra.cc @@ -1746,7 +1746,7 @@ static void opWieldItem(Program* program) int hand = HAND_RIGHT; - bool v1 = false; + bool shouldAdjustArmorClass = false; Object* oldArmor = NULL; Object* newArmor = NULL; if (critter == gDude) { @@ -1756,10 +1756,11 @@ static void opWieldItem(Program* program) if (itemGetType(item) == ITEM_TYPE_ARMOR) { oldArmor = critterGetArmor(gDude); - } - v1 = true; - newArmor = item; + // SFALL + shouldAdjustArmorClass = true; + newArmor = item; + } } if (_inven_wield(critter, item, hand) == -1) { @@ -1769,8 +1770,11 @@ static void opWieldItem(Program* program) } if (critter == gDude) { - if (v1) { + if (shouldAdjustArmorClass) { _adjust_ac(critter, oldArmor, newArmor); + + // SFALL + interfaceRenderArmorClass(false); } bool animated = !gameUiIsDisabled();