Skip to content

Commit

Permalink
fix negative ammo in quivers
Browse files Browse the repository at this point in the history
  • Loading branch information
KorGgenT committed May 6, 2020
1 parent 14d8da3 commit 4a1b2c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/item_pocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,8 @@ void item_pocket::overflow( const tripoint &pos )
for( auto iter = contents.begin(); iter != contents.end(); ) {
item &ammo = *iter;
total_qty += ammo.count();
const int overflow_count = ammo_iter->second - ammo.count() - total_qty;
if( overflow_count > 0 ) {
const int overflow_count = ammo.count() - total_qty;
if( overflow_count > ammo_iter->second ) {
ammo.charges -= overflow_count;
item dropped_ammo( ammo.typeId(), ammo.birthday(), overflow_count );
g->m.add_item_or_charges( pos, contents.front() );
Expand Down

0 comments on commit 4a1b2c2

Please sign in to comment.