Minor bugfix

This commit is contained in:
Anuken
2021-06-03 16:01:51 -04:00
parent c674b5c256
commit 9cd482d389
2 changed files with 2 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 214 B

View File

@@ -390,7 +390,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
player.clearUnit(); player.clearUnit();
//make sure it's AI controlled, so players can't overwrite each other //make sure it's AI controlled, so players can't overwrite each other
}else if(unit.isAI() && unit.team == player.team() && !unit.dead){ }else if(unit.isAI() && unit.team == player.team() && !unit.dead){
if(net.client()){ if(net.client() && player.isLocal()){
player.justSwitchFrom = player.unit(); player.justSwitchFrom = player.unit();
player.justSwitchTo = unit; player.justSwitchTo = unit;
} }
@@ -467,7 +467,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
//only reset the controlled type and control a unit after the timer runs out //only reset the controlled type and control a unit after the timer runs out
//essentially, this means the client waits for 1 second after controlling something before trying to control something else automatically //essentially, this means the client waits for 1 second after controlling something before trying to control something else automatically
if(!player.dead() && (recentRespawnTimer -= Time.delta / 60f) <= 0f){ if(!player.dead() && (recentRespawnTimer -= Time.delta / 60f) <= 0f && player.justSwitchFrom != player.unit()){
controlledType = player.unit().type; controlledType = player.unit().type;
} }