Skip to content

Commit

Permalink
fix: include equipped items when counting quantities of held items in…
Browse files Browse the repository at this point in the history
… the shop
  • Loading branch information
liuzhier authored and PalMusicFan committed Mar 27, 2024
1 parent 7ed2f16 commit 4176ade
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion 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, n, x, y;
int i, j, n, x, y;
PAL_LARGE BYTE bufImage[2048];

//
Expand Down Expand Up @@ -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
//
Expand Down

0 comments on commit 4176ade

Please sign in to comment.