Skip to content

Commit

Permalink
[gamepad] Only warp the cursor if item was moved
Browse files Browse the repository at this point in the history
  • Loading branch information
AJenbo committed Oct 20, 2021
1 parent 8e70cd7 commit d5999e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/controls/plrctrls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,10 @@ void PerformSpellAction()
TryIconCurs();
NewCursor(CURSOR_HAND);
} else {
int itemId = GetItemIdOnSlot(Slot);
CheckInvItem(true, false);
ResetInvCursorPosition();
if (itemId != GetItemIdOnSlot(Slot))
ResetInvCursorPosition();
}
return;
}
Expand Down Expand Up @@ -1533,8 +1535,10 @@ void CtrlUseInvItem()
}

if (item->isEquipment()) {
int itemId = GetItemIdOnSlot(Slot);
CheckInvItem(true, false); // auto-equip if it's an equipment
ResetInvCursorPosition();
if (itemId != GetItemIdOnSlot(Slot))
ResetInvCursorPosition();
} else {
UseInvItem(MyPlayerId, pcursinvitem);
}
Expand Down

0 comments on commit d5999e6

Please sign in to comment.