From 5e832e75d9a267a3439c9e336ff55a8c7049693e Mon Sep 17 00:00:00 2001 From: staphen Date: Sat, 18 Feb 2023 15:06:16 -0500 Subject: [PATCH] Fix alignment for 2x2 armor sprite in the chest slot --- Source/inv.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index 525d52408..a56bf69ab 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1122,13 +1122,10 @@ void DrawInv(const Surface &out) auto frameSize = GetInvItemSize(cursId); - // calc item offsets for weapons smaller than 2x3 slots - if (slot == INVLOC_HAND_LEFT) { + // calc item offsets for weapons/armor smaller than 2x3 slots + if (IsAnyOf(slot, INVLOC_HAND_LEFT, INVLOC_HAND_RIGHT, INVLOC_CHEST)) { screenX += frameSize.width == InventorySlotSizeInPixels.width ? INV_SLOT_HALF_SIZE_PX : 0; screenY += frameSize.height == (3 * InventorySlotSizeInPixels.height) ? 0 : -INV_SLOT_HALF_SIZE_PX; - } else if (slot == INVLOC_HAND_RIGHT) { - screenX += frameSize.width == InventorySlotSizeInPixels.width ? (INV_SLOT_HALF_SIZE_PX - 1) : 1; - screenY += frameSize.height == (3 * InventorySlotSizeInPixels.height) ? 0 : -INV_SLOT_HALF_SIZE_PX; } const ClxSprite sprite = GetInvItemSprite(cursId);