mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
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
This commit is contained in:
parent
e4ecfc4ee7
commit
5037c4e00e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user