Fix clang warning for powerup caps
This commit is contained in:
parent
c0e7f70638
commit
f9469ffe18
|
@ -251,7 +251,7 @@ void powerup_cap_state::cap_secondary_ammo(powerup_type_t type, uint16_t &player
|
|||
const uint_fast32_t maximum_allowed = get_max(idx);
|
||||
if (current_on_player + current_in_mine <= maximum_allowed)
|
||||
return;
|
||||
const auto capped = (current_in_mine < maximum_allowed) ? static_cast<uint16_t>(maximum_allowed - current_in_mine) : 0;
|
||||
const auto capped = static_cast<uint16_t>(current_in_mine < maximum_allowed ? maximum_allowed - current_in_mine : 0);
|
||||
player_ammo = capped;
|
||||
con_printf(CON_VERBOSE, "Capping secondary %u due to powerup cap: current=%u max=%u was=%u now=%hu", idx, get_current(idx), get_max(idx), static_cast<unsigned>(current_on_player), capped);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue