itemTransferRange proper usage

This commit is contained in:
Anuken
2022-03-11 00:35:34 -05:00
parent da1517879a
commit 846a697d2e
9 changed files with 14 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ public enum Binding implements KeyBind{
pan(KeyCode.mouseForward),
boost(KeyCode.shiftLeft),
commandMode(KeyCode.shiftLeft),
command_mode(KeyCode.shiftLeft),
control(KeyCode.controlLeft),
respawn(KeyCode.v),
select(KeyCode.mouseLeft),

View File

@@ -296,8 +296,8 @@ public class DesktopInput extends InputHandler{
if(!locked && block == null && !scene.hasField() &&
//disable command mode when player unit can boost and command mode binding is the same
!(!player.dead() && player.unit().type.canBoost && keybinds.get(Binding.commandMode).key == keybinds.get(Binding.boost).key)){
commandMode = input.keyDown(Binding.commandMode);
!(!player.dead() && player.unit().type.canBoost && keybinds.get(Binding.command_mode).key == keybinds.get(Binding.boost).key)){
commandMode = input.keyDown(Binding.command_mode);
}else{
commandMode = false;
}

View File

@@ -254,7 +254,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
@Remote(called = Loc.server, targets = Loc.both, forward = true)
public static void requestItem(Player player, Building build, Item item, int amount){
if(player == null || build == null || !build.interactable(player.team()) || !player.within(build, buildingRange) || player.dead()) return;
if(player == null || build == null || !build.interactable(player.team()) || !player.within(build, itemTransferRange) || player.dead()) return;
if(net.server() && (!Units.canInteract(player, build) ||
!netServer.admins.allowAction(player, ActionType.withdrawItem, build.tile(), action -> {
@@ -270,7 +270,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
@Remote(targets = Loc.both, forward = true, called = Loc.server)
public static void transferInventory(Player player, Building build){
if(player == null || build == null || !player.within(build, buildingRange) || build.items == null || player.dead()) return;
if(player == null || build == null || !player.within(build, itemTransferRange) || build.items == null || player.dead()) return;
if(net.server() && (player.unit().stack.amount <= 0 || !Units.canInteract(player, build) ||
!netServer.admins.allowAction(player, ActionType.depositItem, build.tile, action -> {