Fix inventory slot switch rubberbanding
This commit is contained in:
parent
db475d8461
commit
e2efe3a298
@ -182,11 +182,11 @@ namespace Cyber.Controls {
|
||||
// Grab was released, drop item here
|
||||
// Lerp things
|
||||
ItemGridCellMeshes[GrabbedItemIndex].transform.position = ItemGridCells[CurrentIndex].position;
|
||||
ItemGridCellMeshes[CurrentIndex].transform.position = ItemGridCells[GrabbedItemIndex].position;
|
||||
Lerper.LerpTransformPosition(ItemGridCellMeshes[GrabbedItemIndex].transform, new Vector3(), 10f);
|
||||
Lerper.LerpTransformPosition(ItemGridCellMeshes[CurrentIndex].transform, new Vector3(), 10f);
|
||||
|
||||
// Switch items
|
||||
Inventory.Drive.SwitchSlots(GrabbedItemIndex, CurrentIndex);
|
||||
Client.Send(PktType.InventoryAction, Inventory.ActionHandler.BuildSlotSwitch(GrabbedItemIndex, CurrentIndex));
|
||||
|
||||
// Reset grabbing
|
||||
|
@ -81,7 +81,9 @@ namespace Cyber.Items {
|
||||
}
|
||||
return false;
|
||||
case InventoryAction.Switch:
|
||||
Inventory.Drive.SwitchSlots(intList[0], intList[1]);
|
||||
if (!Client.IsRunning() || Client.GetConnectedPlayer().Character != Character) {
|
||||
Inventory.Drive.SwitchSlots(intList[0], intList[1]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user