Swap order of attacker/target null checks in ADS, fixes #185

This commit is contained in:
Electroblob77
2019-09-04 13:11:08 +01:00
parent c39a213e62
commit 06d02ad45d
@@ -111,12 +111,12 @@ public final class AllyDesignationSystem {
*/
public static boolean isValidTarget(Entity attacker, Entity target){
// Always return true if the attacker is null
if(attacker == null) return true;
// Always return false if the target is null
if(target == null) return false;
// Always return true if the attacker is null - this must be after the target null check!
if(attacker == null) return true;
// Tests whether the target is the attacker
if(target == attacker) return false;