Skip to content

Commit

Permalink
Merge pull request #68124 from ferociousdork/cash_card_overflow
Browse files Browse the repository at this point in the history
Fix overflow when using cash card charges
  • Loading branch information
Rivet-the-Zombie authored Sep 15, 2023
2 parents b2a5b91 + 7ed2071 commit d6d150c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10727,7 +10727,8 @@ int item::ammo_consume( int qty, const tripoint &pos, Character *carrier )

// Modded tools can consume UPS/bionic energy instead of ammo.
// Guns handle energy in energy_consume()
if( carrier != nullptr && type->tool ) {
if( carrier != nullptr && type->tool &&
( has_flag( flag_USE_UPS ) || has_flag( flag_USES_BIONIC_POWER ) ) ) {
units::energy wanted_energy = units::from_kilojoule( qty );

if( has_flag( flag_USE_UPS ) ) {
Expand Down

0 comments on commit d6d150c

Please sign in to comment.