Skip to content

Commit

Permalink
fix: Make rags consume their charges/delete themselves. (#5589)
Browse files Browse the repository at this point in the history
Make rags consume their charges/delete themselves.
  • Loading branch information
KheirFerrum authored Oct 19, 2024
1 parent 3469dd0 commit 88c3a84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7641,6 +7641,12 @@ bool Character::invoke_item( item *used, const std::string &method, const tripoi
} else if( used->is_bionic() || used->is_deployable() || method == "place_trap" ) {
used->detach();
return true;
} else if( used->count_by_charges() ) {
used->charges -= charges_used;
if( used->charges <= 0 ) {
used->detach();
}
return true;
}

return false;
Expand Down

0 comments on commit 88c3a84

Please sign in to comment.