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

Spell casting menu will always choose the 1st option #76042

Closed
Cddasurvivor opened this issue Aug 30, 2024 · 6 comments · Fixed by #76137
Closed

Spell casting menu will always choose the 1st option #76042

Cddasurvivor opened this issue Aug 30, 2024 · 6 comments · Fixed by #76137
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@Cddasurvivor
Copy link

Describe the bug

In the most recent experimental as of this posting if you cast any spell on your spell list it will choose the spell at the top of the spell list over anything you select even if you make a custom hotkey for that spell.

Attach save file

N/A

Steps to reproduce

1)Create a character

2)Learn multiple spells such as learning Spider Climb.

3)You have the Spider Climb spell and the Magus Rune spell for being in the Magus school.

4)Your spell list is:

a)Magus Rune
b)Spider Climb

5)Use Spider Climb and it will cast Magus Rune.

6)Change the hotkey of Magus Run to a lower letter like z.

a)Spider Climb
z)Magus Rune

7)Cast Magus Rune and it will cast Spider Climb instead.

Expected behavior

Should cast the spell you select but will always pick the spell highest on the list of spells.

Screenshots

N/a

Versions and configuration

Experimental 2024-8-30-0021

Additional context

No response

@Cddasurvivor Cddasurvivor added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Aug 30, 2024
@JohnHenryEton
Copy link

My menu is not casting the first, but is casting wrong spells.
One of two specific spells, actually, depending on what I'm trying to cast it either attempts to cast Nature's Bow or Dream Dagger.

@Molgador
Copy link

Downgrading my game version to before the 2024-08-29-0114 release fixed it for me, so I'd guess it has something to do with #75624

@Shibimon
Copy link

I have arround 20 spells and its changing ALL of them to other spells when clicking/cursor select/shortcut press is consistent in that run of the game and using that spell will allways cast the same other wrong one, but closing and opening the game seems to sometimes switch the wrong spells for other different wrong spells.
Not super sure if it has something to do with it but since the new style of menus is breaking parts of the game descriptions (like spells descriptions upon trying to learn them, or the time it will cost to butcher options something) has inconsistent behavior and sometimes i have to roll the mousewheel to be able to move the highlight select, my guess is its at least closely related to this.

@JohnHenryEton
Copy link

Downgrading my game version to before the 2024-08-29-0114 release fixed it for me, so I'd guess it has something to do with #75624

This fixes the issue for me as well.

@Torres84f
Copy link

Yeah same thing happening to me

@ThePotatomancer
Copy link
Contributor

ThePotatomancer commented Sep 1, 2024

Alright so I debugged and looked into it, the problem seems to be specifically in handle_action.cpp, the spell list returns a selected index, but the spell list in the ui with the hotkeys is sorted, while the one in handle_action.cpp that it references with get_spells is not. I will open a pr to fix it, probably by switching handle_action to use a new get_sorted_spells instead of get_spells

ThePotatomancer added a commit to ThePotatomancer/Cataclysm-DDA that referenced this issue Sep 2, 2024
the wrong spell to be cast
currently selecting a spell in a long sorted spell
list will cast the wrong spell due to select spell returing a sorted
spell id while handle_action.cpp looks only at the unsorted spells

fixes CleverRaven#76042
Fix an issue where trying to cast a spell causes
the wrong spell to be cast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants