From 5037c4e00e51b70fcfd9f817233736fdcd6c04cf Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Sat, 27 Feb 2021 10:12:00 -0500 Subject: [PATCH] Fix a few issues w/ double tap mining (#4798) Currently, double tap mining consumes clicks so it prevents the player from configuring any block if they click twice within 500ms. The double tap mining was also using the `selected` var which could have been null causing a crash. This is a very messy solution but it does the job good enough --- core/src/mindustry/input/DesktopInput.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 4b7143b22f..a5114a4832 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -491,12 +491,10 @@ public class DesktopInput extends InputHandler{ sreq = req; }else if(req != null && req.breaking){ deleting = true; - }else if(Core.settings.getBool("doubletapmine") && selected == prevSelected && Time.timeSinceMillis(selectMillis) < 500){ - tryBeginMine(selected); }else if(selected != null){ //only begin shooting if there's no cursor event if(!tryTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y) && !tileTapped(selected.build) && !player.unit().activelyBuilding() && !droppingItem - && (Core.settings.getBool("doubletapmine") ? !tryStopMine(selected) : !tryBeginMine(selected)) && !Core.scene.hasKeyboard()){ + && !((!settings.getBool("doubletapmine") || selected == prevSelected && Time.timeSinceMillis(selectMillis) < 500) && tryBeginMine(selected)) && !Core.scene.hasKeyboard()){ player.shooting = shouldShoot; } }else if(!Core.scene.hasKeyboard()){ //if it's out of bounds, shooting is just fine