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

Unloading magazines (especially belts) can lead to player move starvation for a long time. #23440

Closed
kevingranade opened this issue Apr 10, 2018 · 2 comments

Comments

Projects
2 participants
@kevingranade
Copy link
Member

commented Apr 10, 2018

Expected behavior

Unloading an ammunition belt can be interrupted by '.' or safe mode.

Actual behavior

Unloading an ammunition belt is uninterruptable and can allow a monster to kill you while performing it.

Steps to reproduce the behavior

Stand near the corner of a building.
Spawn a full (hundreds of rounds) ammunition belt.
Spwn a hostile monster nearby.
Run around the corner of the building, breaking sight with the monster.
Turn on safe mode.
'U'nload the ammunition belt.
Monster will round the corner and attack a large number of times before the layer has an opportunity to act.

Thnaks to vipchess for reporting: https://discourse.cataclysmdda.org/t/is-there-something-wrong-about-the-ammo-belt/15257

@kevingranade

This comment has been minimized.

Copy link
Member Author

commented Apr 10, 2018

Fix should be straightforward, take the code starting at https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/game.cpp#L10413 and move it to a new activity handler, which will incrementally unload the target magazine or gun without letting player::moves go far into negatives.

There's also an opportunity to resolve #18489 by preventing the player from dropping the magazine while unloading it. (probably just a matter of making sure the casings and ammunition are dropped instead of the magizine or gun)

@kevingranade kevingranade added this to the 0.D milestone Aug 17, 2018

@kevingranade kevingranade added this to Easy Issues in 0.D Release Aug 17, 2018

@kevingranade kevingranade moved this from Easy Issues to Less hard issues in 0.D Release Aug 21, 2018

@kevingranade kevingranade moved this from Less hard issues to Fix Proposed in 0.D Release Sep 26, 2018

@Inglonias

This comment has been minimized.

Copy link
Contributor

commented Dec 7, 2018

The code referenced in Kevin's comment seems to have moved since... wow. April.

For those who want to take a crack at this, the code he's referring to is now a couple hundred lines up the file, here:
https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/game.cpp#L9856

@kevingranade kevingranade moved this from Fix Proposed to Confirm Fix in 0.D Release Jan 11, 2019

0.D Release automation moved this from Confirm Fix to Closed Issues Jan 12, 2019

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.