Skip to content

Commit

Permalink
fix: Fireweapons stop being destroyed when running out of charges. (#…
Browse files Browse the repository at this point in the history
…5967)

Update iuse_actor.cpp

Removes the extinguish when it hits zero charges, that is handled by process_tool. It just needs to check to proc it's special message.
  • Loading branch information
KheirFerrum authored Jan 24, 2025
1 parent 044e30d commit 04d54c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/iuse_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,8 @@ int fireweapon_on_actor::use( player &p, item &it, bool t, const tripoint & ) co
bool extinguish = true;
if( it.charges == 0 ) {
p.add_msg_if_player( m_bad, _( charges_extinguish_message ) );
// Revert when it runs out of charges is handled in process_tool.
extinguish = false;
} else if( p.is_underwater() ) {
p.add_msg_if_player( m_bad, _( water_extinguish_message ) );
} else if( auto_extinguish_chance > 0 && one_in( auto_extinguish_chance ) ) {
Expand All @@ -2274,7 +2276,6 @@ int fireweapon_on_actor::use( player &p, item &it, bool t, const tripoint & ) co
it.revert( &p, false );
it.deactivate();
return 0;

} else if( one_in( noise_chance ) ) {
if( noise > 0 ) {
sounds::sound( p.pos(), noise, sounds::sound_t::combat, _( noise_message ) );
Expand Down

0 comments on commit 04d54c3

Please sign in to comment.