CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.53k stars 4.16k forks source link

Reloading with Held Item Prompts to Drop Held Item; Doing So Crashes #42179

Closed Grubleafeater closed 4 years ago

Grubleafeater commented 4 years ago

Describe the bug

When you reload and are holding a item, you're prompted to drop it. If that held item is the thing you're trying to reload with(such as a battery), it crashes the game.

Steps To Reproduce

Pick up a battery. Reload a flashlight or headlamp already containing a battery with that battery. Drop the battery.

Expected behavior

Reloading shouldn't even be asking me to drop the held item in the first place. Especially when it's what I'm using to reload.

Screenshots

Versions and configuration

Additional context

OmeleteDuFroMago commented 4 years ago

This is happening too when i try to reload a bone needle.

ZaricaDemoni commented 4 years ago

the crash is possibly coming from the fact its being dropped, reloading things right now from what ive seen anywhere but inventory tends to cause a crash (fix in progress), but definitely agree with the expected behavior, dropping a battery to put it inside a flashlight?

sadly no version/configuration info, crash log, or world file so it makes verifying things harder. just a pointer for future posts regarding crashes, and adding those here would definitely help figure out if this is indeed related to the other issue or not.

Qrox commented 4 years ago

I guess it's because the code requires the player to have an item in the inventory to reload it, if the item does not have the ALLOWS_REMOTE_USE flag.

https://github.com/CleverRaven/Cataclysm-DDA/blob/3b15cc45743547a88c8ed3bbcb4f7d75f0ab6002/src/game.cpp#L8882-L8885

UrbanCMC commented 4 years ago

I can't reproduce the crash on build 10845. Dropping the battery first is still a thing though.

ZaricaDemoni commented 4 years ago

that does definitely mean this was a duplicate of #42089 which was fixed by #42162 and is no longer about a crash.

ZhilkinSerg commented 4 years ago

Duplicate of #42089.