From 4176ade91798a11fc1232bac5133b040f9319e5d Mon Sep 17 00:00:00 2001 From: liuzhier <2298813582@qq.com> Date: Tue, 12 Mar 2024 09:27:59 +0800 Subject: [PATCH] fix: include equipped items when counting quantities of held items in the shop --- uigame.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/uigame.c b/uigame.c index 4439a0b3..cdf492bb 100644 --- a/uigame.c +++ b/uigame.c @@ -1513,7 +1513,7 @@ PAL_BuyMenu_OnItemChange( --*/ { const SDL_Rect rect = {20, 8, 300, 175}; - int i, n, x, y; + int i, j, n, x, y; PAL_LARGE BYTE bufImage[2048]; // @@ -1558,6 +1558,14 @@ PAL_BuyMenu_OnItemChange( } } + for (i = 0; i < MAX_PLAYER_EQUIPMENTS; i++) + { + for (j = 0; j < MAX_PLAYER_ROLES; j++) + { + if (gpGlobals->g.PlayerRoles.rgwEquipment[i][j] == wCurrentItem) n++; + } + } + // // Prepare inventory quantities pos //