itemTransferRange proper usage
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 -> {
|
||||
|
||||
Reference in New Issue
Block a user