Skip to content

Commit

Permalink
refix: include equipped items when counting quantities of held items …
Browse files Browse the repository at this point in the history
…in the shop

Continue 4176ade. Thanks to @rym1020 for reporting the bug.
  • Loading branch information
liuzhier authored and palxex committed May 27, 2024
1 parent 30b0ee8 commit 4a2aa6f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions uigame.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ PAL_BuyMenu_OnItemChange(
--*/
{
const SDL_Rect rect = {20, 8, 300, 175};
int i, j, n, x, y;
int i, j, n, iPlayerID, x, y;
PAL_LARGE BYTE bufImage[2048];

//
Expand Down Expand Up @@ -1560,9 +1560,11 @@ PAL_BuyMenu_OnItemChange(

for (i = 0; i < MAX_PLAYER_EQUIPMENTS; i++)
{
for (j = 0; j < MAX_PLAYER_ROLES; j++)
for (j = 0; j <= gpGlobals->wMaxPartyMemberIndex; j++)
{
if (gpGlobals->g.PlayerRoles.rgwEquipment[i][j] == wCurrentItem) n++;
iPlayerID = gpGlobals->rgParty[j].wPlayerRole;

if (gpGlobals->g.PlayerRoles.rgwEquipment[i][iPlayerID] == wCurrentItem) n++;
}
}

Expand Down

0 comments on commit 4a2aa6f

Please sign in to comment.