From ac2e2800b5456114876534e3f5c33f2dae63989a Mon Sep 17 00:00:00 2001 From: DakkJaniels <6080734+DakkJaniels@users.noreply.github.com> Date: Sun, 17 Apr 2022 10:35:10 -0400 Subject: [PATCH] Fix Durability Icons (#4475) * fix 0 index for durability icons * Add ItemType::Shield (clarity) Add ItemType::Shield to switch/case for clarity, so it is clear that this is what the default option was to show. --- Source/control.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index 1c37adbc2..ab2075663 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -281,22 +281,23 @@ int DrawDurIcon4Item(const Surface &out, Item &pItem, int x, int c) if (c == 0) { switch (pItem._itype) { case ItemType::Sword: - c = 2; + c = 1; break; case ItemType::Axe: - c = 6; + c = 5; break; case ItemType::Bow: - c = 7; + c = 6; break; case ItemType::Mace: - c = 5; + c = 4; break; case ItemType::Staff: - c = 8; + c = 7; break; + case ItemType::Shield: default: - c = 1; + c = 0; break; } } @@ -1008,8 +1009,8 @@ void DrawDurIcon(const Surface &out) } auto &myPlayer = Players[MyPlayerId]; - x = DrawDurIcon4Item(out, myPlayer.InvBody[INVLOC_HEAD], x, 4); - x = DrawDurIcon4Item(out, myPlayer.InvBody[INVLOC_CHEST], x, 3); + x = DrawDurIcon4Item(out, myPlayer.InvBody[INVLOC_HEAD], x, 3); + x = DrawDurIcon4Item(out, myPlayer.InvBody[INVLOC_CHEST], x, 2); x = DrawDurIcon4Item(out, myPlayer.InvBody[INVLOC_HAND_LEFT], x, 0); DrawDurIcon4Item(out, myPlayer.InvBody[INVLOC_HAND_RIGHT], x, 0); }