Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Survival bow asks user to select an arrow type for reload after firing, but it doesn't do anything

Open CoroNaut opened this issue 1 year ago • 2 comments

Describe the bug

I understand that we probably don't keep an arrow 'in the bow' like a bullet in a gun. When you shoot your survival bow, it asks you to reload the weapon with a new arrow, but this action does nothing. then if you want to fire again, it pops up the exact same dialog to ask you what arrow to use, which works.

Attach save file

Grafton-trimmed.tar.gz

Steps to reproduce

  1. get survival bow or any bow
  2. see enemy
  3. knock arrow and fire
  4. reload dialog pop asks for an arrow to reload with, but does nothing
  5. repeat 3

Expected behavior

Preferably, the dialog asking the user to reload the bow would work and actually bring you right back to the aiming interface.

  1. see enemy
  2. knock arrow and fire
  3. reload and fire
  4. repeat step 3

I would also LOVE to see it not popup a dialog if you only have one arrow type in your inventory. it used to be this way, but it changed at some point a year or two ago to always show a dialog for even a singular ammo type. Then i could just stay on the aiming interface and fire arrow after arrow.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.4651 (22H2)
  • Game Version: cdda-experimental-2024-09-04-0626 0c909b2 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth] ]

Additional context

No response

CoroNaut avatar Sep 05 '24 10:09 CoroNaut

It should be a side effect of #73550. The feature AIM_AFTER_FIRING was disabled for the bows, and I didn't make a proper solution when enable it for the bows. If favorite ammo is set for your bow, it works as intended, but if you have not set it and carry more than one kind of arrows, this dumb thing happens. Will try to solve it later.

I would also LOVE to see it not popup a dialog if you only have one arrow type in your inventory.

I think it's #70359 that changed how it works. There are also some other side effects caused by it, and I didn't find out how to deal with them.

osuphobia avatar Sep 06 '24 07:09 osuphobia

After actually testing it, I found out what's happening (it's been a while after my PR got merged so I forgot how I did it in detail😂). If you are aiming at a real enemy, things work as intented. Only when aiming at a practice target (which does not count as a real target), or just drawing your bow with out a target, the things in question will happen. https://github.com/CleverRaven/Cataclysm-DDA/blob/e398be14514639f1e6aa512d8fd39c908b347eed/src/ranged.cpp#L2652-L2659 In fact, you did select an arrow, but as there are no targets available, you just quit the aim ui. So it's not as serious an issue as I thought, no real troubles happen in combat. Will try to change the order of the functions to make it not confusing when using bows.

osuphobia avatar Sep 07 '24 01:09 osuphobia