Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: More charge usage shenanigans (fireweapon edition) #5870

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

KheirFerrum
Copy link
Collaborator

@KheirFerrum KheirFerrum commented Jan 3, 2025

Checklist

Required

Purpose of change

Describe the solution

  • fireweapon iuse code now properly returns 0 if the item is reverted/deactivated instead of trying to consume it's charges.

Describe alternatives you've considered

  • Remove fireweapon code.
    • That's on the docket and part of the energy rework, but I don't want to produce any conflicts at the moment given that the energy rework is already a monumental PR that will be hell to test.

Testing

@chaosvolt Help me test please I have work.

  • Fireweapons shouldn't fucking consume themselves when a revert is specified.

Additional context

I fucking hate when fixing code causes issues.

bool extinguish = true;
if( it.charges == 0 ) {
p.add_msg_if_player( m_bad, _( charges_extinguish_message ) );
} 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 ) ) {
p.add_msg_if_player( m_bad, _( auto_extinguish_message ) );
} else if( !t ) {
p.add_msg_if_player( _( voluntary_extinguish_message ) );
} else {
extinguish = false;
}

Dear lord in heaven why is this code?

Doesn't attempt to consume a charge if the fireweapon has reverted.
@github-actions github-actions bot added the src changes related to source code. label Jan 3, 2025
@KheirFerrum KheirFerrum changed the title fix: More charge usage shenanigans fix: More charge usage shenanigans (fireweapon edition) Jan 3, 2025
@scarf005 scarf005 merged commit 7c55574 into cataclysmbnteam:main Jan 3, 2025
16 checks passed
@KheirFerrum KheirFerrum deleted the Fireweapon-fix branch January 4, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Active fire weapons vanish on running out of charges
2 participants