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 instantly exploding grenades #17060

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
3 participants
@Coolthulhu
Copy link
Contributor

commented Jun 5, 2016

Fixes #17055

Not the cleanest solution, but better than waiting for a proper one.

Allows iuse_transform to force charges above maximum.

Also makes charged items display their charges unconditionally.

@mugling

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2016

That's a fairly painful hack that entirely subverts the meaning of that function. We should patch the problem at the source not via a hack to ammo_set which is called from innumerable locations. The function shouldn't be being used if it's not for setting the ammo type.

@@ -2373,7 +2377,7 @@ std::string item::display_name(unsigned int quantity) const
qty = string_format(" (%i)", ammo_remaining());
} else if( is_ammo_container() && !contents.empty() ) {
qty = string_format( " (%i)", contents.front().charges );
} else if( count_by_charges() ) {
} else if( charges > 0 || count_by_charges() ) {

This comment has been minimized.

Copy link
@kevingranade

kevingranade Jun 5, 2016

Member

Are you trying to enable a countdown-type thing? There shouldn't be one. Dynamite is kind of weird in that it's visible, but the countdown state of other things shouldn't be, and in fact could potentially be a little randomized.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jun 5, 2016

I agree, it seems a lot cleaner to do the right thing in iuse_transform::use(), bypassing ammo_set() entirely. Poking at it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.