Browse Source

[gamepad] Prevent warping from row 9 and 10 to belt

pull/3178/head
Anders Jenbo 5 years ago
parent
commit
2f925bfeb7
  1. 9
      Source/controls/plrctrls.cpp

9
Source/controls/plrctrls.cpp

@ -851,8 +851,8 @@ void InvMove(AxisDirection dir)
mousePos = GetSlotCoord(Slot); mousePos = GetSlotCoord(Slot);
} else if (Slot <= SLOTXY_INV_LAST && myPlayer.HoldItem._itype == ItemType::Misc && icursSize28 == Size { 1, 1 }) { // forcing only 1x1 misc items } else if (Slot <= SLOTXY_INV_LAST && myPlayer.HoldItem._itype == ItemType::Misc && icursSize28 == Size { 1, 1 }) { // forcing only 1x1 misc items
Slot += INV_ROW_SLOT_SIZE; Slot += INV_ROW_SLOT_SIZE;
if (Slot > SLOTXY_BELT_LAST) if (Slot + INV_ROW_SLOT_SIZE <= SLOTXY_BELT_LAST)
Slot = SLOTXY_BELT_LAST; Slot += INV_ROW_SLOT_SIZE;
mousePos = GetSlotCoord(Slot); mousePos = GetSlotCoord(Slot);
} }
} else { } else {
@ -883,9 +883,8 @@ void InvMove(AxisDirection dir)
mousePos = GetSlotCoord(Slot); mousePos = GetSlotCoord(Slot);
} else if (Slot <= SLOTXY_INV_LAST) { } else if (Slot <= SLOTXY_INV_LAST) {
Size itemSize = GetItemSizeOnSlot(Slot); Size itemSize = GetItemSizeOnSlot(Slot);
Slot += itemSize.height * INV_ROW_SLOT_SIZE; if (Slot + itemSize.height * INV_ROW_SLOT_SIZE <= SLOTXY_BELT_LAST)
if (Slot > SLOTXY_BELT_LAST) Slot += itemSize.height * INV_ROW_SLOT_SIZE;
Slot = SLOTXY_BELT_LAST;
mousePos = GetSlotCoord(Slot); mousePos = GetSlotCoord(Slot);
} }
} }

Loading…
Cancel
Save