Potentially fixed targeting issues

This commit is contained in:
Anuken
2018-10-17 14:01:18 -04:00
parent 4614aacc02
commit 245dd39a60
2 changed files with 2 additions and 2 deletions

View File

@@ -85,7 +85,7 @@ public class MobileInput extends InputHandler implements GestureListener{
/** Check and assign targets for a specific position. */
void checkTargets(float x, float y){
synchronized(Entities.entityLock){
Unit unit = Units.getClosestEnemy(player.getTeam(), x, y, 20f, u -> true);
Unit unit = Units.getClosestEnemy(player.getTeam(), x, y, 20f, u -> !u.isDead() && u.isAdded());
if(unit != null){
threads.run(() -> player.target = unit);