diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 031f5af2bf..7077a1dfbc 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -114,12 +114,12 @@ public class DesktopInput extends InputHandler{ //draw break selection if(mode == breaking){ - drawBreakSelection(selectX, selectY, cursorX, cursorY, !Core.input.keyDown(Binding.schematic_select) ? maxLength : Vars.maxSchematicSize, false); + drawBreakSelection(selectX, selectY, cursorX, cursorY, !(Core.input.keyDown(Binding.schematic_select) && schemX != -1 && schemY != -1) ? maxLength : Vars.maxSchematicSize, false); } if(!Core.scene.hasKeyboard() && mode != breaking){ - if(Core.input.keyDown(Binding.schematic_select)){ + if(Core.input.keyDown(Binding.schematic_select) && schemX != -1 && schemY != -1){ drawSelection(schemX, schemY, cursorX, cursorY, Vars.maxSchematicSize); }else if(Core.input.keyDown(Binding.rebuild_select)){ drawRebuildSelection(schemX, schemY, cursorX, cursorY); @@ -594,7 +594,7 @@ public class DesktopInput extends InputHandler{ selectPlans.clear(); } - if( !Core.scene.hasKeyboard() && selectX == -1 && selectY == -1 && schemX != -1 && schemY != -1){ + if(!Core.scene.hasKeyboard() && selectX == -1 && selectY == -1 && schemX != -1 && schemY != -1){ if(Core.input.keyRelease(Binding.schematic_select)){ lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY); useSchematic(lastSchematic);