Skip to content

Commit 8900967

Browse files
committed
Fixed #11425
1 parent 3e29667 commit 8900967

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

core/src/mindustry/input/DesktopInput.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ boolean showHint(){
6868
(!isBuilding && !Core.settings.getBool("buildautopause") || player.unit().isBuilding() || !player.dead() && !player.unit().spawnedByCore());
6969
}
7070

71+
@Override
72+
public void reset(){
73+
super.reset();
74+
shouldShoot = false;
75+
deleting = false;
76+
}
77+
7178
@Override
7279
public void buildUI(Group group){
7380
//building and respawn hints

core/src/mindustry/input/InputHandler.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,7 @@ public InputHandler(){
154154
});
155155

156156
Events.on(ResetEvent.class, e -> {
157-
logicCutscene = false;
158-
commandBuildings.clear();
159-
selectedUnits.clear();
160-
itemDepositCooldown = 0f;
161-
Arrays.fill(controlGroups, null);
162-
lastUnit = null;
163-
lastPlans.clear();
157+
reset();
164158
});
165159
}
166160

@@ -885,6 +879,17 @@ public void spectate(Unit unit){
885879
camera.position.set(unit);
886880
}
887881

882+
public void reset(){
883+
logicCutscene = false;
884+
commandBuildings.clear();
885+
selectedUnits.clear();
886+
itemDepositCooldown = 0f;
887+
Arrays.fill(controlGroups, null);
888+
lastUnit = null;
889+
lastPlans.clear();
890+
player.shooting = false;
891+
}
892+
888893
public void update(){
889894
if(spectating != null && (!spectating.isValid() || spectating.team != player.team())){
890895
spectating = null;

core/src/mindustry/input/MobileInput.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,12 @@ public void updateState(){
744744
}
745745
}
746746

747+
@Override
748+
public void reset(){
749+
super.reset();
750+
manualShooting = down = false;
751+
}
752+
747753
@Override
748754
public void update(){
749755
super.update();

0 commit comments

Comments
 (0)