CleverRaven / Cataclysm-DDA

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

Unable to reload mag loaded gun with different ammunition type #74088

Open Brroleg opened 5 months ago

Brroleg commented 5 months ago

Describe the bug

When aiming magazine type gun (for example Glock) and press "o" to load mag with different ammo type it says "you aren't holding something you can reload"

Attach save file

N/A

Steps to reproduce

  1. Get a gun with mag loading (Glock for example)
  2. Get a few mags and fill them with different ammo type each (for example FMJ and JHP)
  3. Load gun with any mag
  4. Try to switch to a mag with different ammo type

Expected behavior

Expected to be able to change mag with different ammo type on mag loading guns

Screenshots

8791275

Versions and configuration

Additional context

N/A

osuphobia commented 5 months ago

That's because you are wielding a weapon fully loaded. Although it's saying "reload/switch ammo" in the aim ui, it actually only works as reloading for guns now, "switch ammo" is for turrets on vehichle. https://github.com/CleverRaven/Cataclysm-DDA/blob/8227806eeb40e198a56504b459d90fc6cf8c548d/src/ranged.cpp#L3488-L3511 See the function target_ui::action_switch_ammo() for more details. I added the method to switch ammo for RAS weapons (bows, slingshots, etc) in it here #73550 , and is modifying it in my new PR to make it works perfectly, but for normal guns without the flag RELOAD_AND_SHOOT, no such method exists, and it may not be that easy to add such method for normal guns.

osuphobia commented 5 months ago

To make it clearer, if the gun is not fully loaded, in this case it's like Glock pistol (12/13), by pressing o you can reload your gun with .45 FMJ or JHP. If you want to "switch ammo", what you are going to do is first to unload the mag, then choose and reload a new mag into your gun. That's not something intended for you to do with the option currently.

Brroleg commented 5 months ago

To make it clearer, if the gun is not fully loaded, in this case it's like Glock pistol (12/13), by pressing o you can reload your gun with .45 FMJ or JHP. If you want to "switch ammo", what you are going to do is first to unload the mag, then choose and reload a new mag into your gun. That's not something intended for you to do with the option currently.

If i unload and try to reload empty Glock, it just suggests to load mag with ammo which name comes alphabetically first, and brands entire stack of mags as those containing only this type of ammo, but in the inventory they are loaded with different types of ammo 183265

osuphobia commented 5 months ago

If i unload and try to reload empty Glock, it just suggests to load mag with ammo which name comes alphabetically first, and brands entire stack of mags as those containing only this type of ammo, but in the inventory they are loaded with different types of ammo

20240527093212 20240527093221

No, it's just that the columns collapsed, expand the line and you can see them all.

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.