diasurgical / devilutionX

Diablo build for modern operating systems
Other
8.01k stars 786 forks source link

[Issue Report]: Cast from Charge Without Meeting Item Requirements #7398

Open NiteKat opened 3 weeks ago

NiteKat commented 3 weeks ago

Operating System

Windows x64

DevilutionX version

1.5.2

Describe

If you have + stats that let you equip a staff the game automatically swaps your spell to the charge spell on equip. If you shift swap the staff into being equipped and with this action simultaneously lose the stats to use the staff, the staff is equipped, red, doesn't show up on the character sprite (as expected) but the spell is still set to the charge spell and can be cast once before your spell is set to nothing. If you pickup any items out of your inventory, or set any down any item in your inventory your spell is also set to nothing. Dropping an item from cursor onto the floor is okay and keeps your spell as the charge spell, so shift swapping is not 100% necessary.

To Reproduce

  1. Find a staff whose stats you do not meet without help from + stat items.
  2. Find a + stat weapon or shield that will allow you to equip the staff.
  3. Equip the staff via shift swapping or pick up the staff and drop it into the equipped slot.
  4. If you equipped it by dropping it into the slot, you need to drop the item in your cursor onto the ground to keep the charge spell ready; if you shift swapped, you can skip this step since your cursor is the hand already. If you pickup/set down an item in your inventory, the spell will be cleared.
  5. Right click anywhere in the dungeon, you get one cast of the charge spell, then your spell is cleared.

Expected Behavior

When you lose the stats to use the staff, you should not be able to cast its charges even once. Game should move your spell to nothing when it detects the staff can't be used anymore.

Additional context

image image image image image image

julealgon commented 3 weeks ago

Nice find.

I hate how they (Blizzard) decided to do the whole item requirement thing with this some sort of cache value in the item itself. I don't think that has been changed in DevilutionX yet (I might be wrong) but it just leads to these crazy scenarios happening. I really think any item-based checks should just be done in real-time every time there is an equipment change, and done in a centralized manner.

AJenbo commented 2 weeks ago

Is this vanilla or specific to DevilutionX?