Skip to content

Commit

Permalink
GAME: Imperius ammo can be collected even when you have the maximum q…
Browse files Browse the repository at this point in the history
…uantity #311
  • Loading branch information
mgerhardy committed Nov 2, 2024
1 parent 235fff4 commit c34ee8d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code/game/bg_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,19 @@ pickupresult_t BG_CanItemBeGrabbed(int gametype, const entityState_t *ent, const
}
return PICKUP_OK; // weapons are always picked up

case IT_AMMO:
case IT_AMMO: {
int maxAmmoCount = MAXAMMO_WEAPON;
if (item->giTag == WP_IMPERIUS) {
maxAmmoCount = MAXAMMO_IMPERIUS;
}
if (BG_IsKillerDuck(ps)) {
return PICKUP_NOT_ALLOWED;
}
if (ps->ammo[item->giTag] >= MAXAMMO_WEAPON) {
if (ps->ammo[item->giTag] >= maxAmmoCount) {
return PICKUP_NOT_ALLOWED; // can't hold any more
}
return PICKUP_OK;
}

case IT_ARMOR:
if (ps->stats[STAT_ARMOR] >= ps->stats[STAT_MAX_HEALTH] * 2) {
Expand Down

0 comments on commit c34ee8d

Please sign in to comment.