From 06d02ad45d5d612b707a69d41a2d7fa53377af2c Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Wed, 4 Sep 2019 13:11:08 +0100 Subject: [PATCH] Swap order of attacker/target null checks in ADS, fixes #185 --- .../electroblob/wizardry/util/AllyDesignationSystem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/electroblob/wizardry/util/AllyDesignationSystem.java b/src/main/java/electroblob/wizardry/util/AllyDesignationSystem.java index a066a9eb..0734ed5d 100644 --- a/src/main/java/electroblob/wizardry/util/AllyDesignationSystem.java +++ b/src/main/java/electroblob/wizardry/util/AllyDesignationSystem.java @@ -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;