Fix invalid items or itemamount from displaying SAD in the item slot
This commit is contained in:
parent
e30774477f
commit
26fe00f1e8
1 changed files with 9 additions and 1 deletions
10
src/k_hud.c
10
src/k_hud.c
|
|
@ -1434,7 +1434,15 @@ static void K_drawKartItem(void)
|
|||
if (stplyr->itemamount <= 0 && stplyr->itemusecooldown <= 0)
|
||||
return;
|
||||
|
||||
localpatch = K_GetCachedItemPatch(stplyr->itemtype, tiny, stplyr->itemamount);
|
||||
if (stplyr->itemtype == 0 && stplyr->itemusecooldown <= 0)
|
||||
return;
|
||||
|
||||
if (stplyr->itemtype >= numkartitems && stplyr->itemtype != MAXKARTITEMS)
|
||||
return;
|
||||
|
||||
if (stplyr->itemtype > 0 && stplyr->itemamount > 0)
|
||||
localpatch = K_GetCachedItemPatch(stplyr->itemtype, tiny, stplyr->itemamount);
|
||||
|
||||
if (localpatch == NULL)
|
||||
localpatch = kp_nodraw; // diagnose underflows
|
||||
else if (K_IsKartItemAlternate(stplyr->itemtype) && K_ShowAltItemIcon(stplyr->itemtype, tiny))
|
||||
|
|
|
|||
Loading…
Reference in a new issue