diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 3fb7d31065..a696659c1f 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -156,6 +156,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ @Remote(targets = Loc.client, called = Loc.server) public static void dropItem(Player player, float angle){ + if(player == null) return; + if(net.server() && player.unit().stack.amount <= 0){ throw new ValidateException(player, "Player cannot drop an item."); } @@ -208,7 +210,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ @Remote(targets = Loc.both, called = Loc.both, forward = true) public static void tileConfig(Player player, Building tile, @Nullable Object value){ - if(tile == null) return; + if(tile == null || player == null) return; if(net.server() && (!Units.canInteract(player, tile) || !netServer.admins.allowAction(player, ActionType.configure, tile.tile(), action -> action.config = value))) throw new ValidateException(player, "Player cannot configure a tile."); tile.configured(player, value); @@ -217,6 +219,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ @Remote(targets = Loc.both, called = Loc.both, forward = true) public static void unitControl(Player player, @Nullable Unit unit){ + if(player == null) return; + //clear player unit when they possess a core if((unit instanceof BlockUnitc && ((BlockUnitc)unit).tile() instanceof CoreBuild)){ Fx.spawn.at(player);