Swap order of attacker/target null checks in ADS, fixes #185
This commit is contained in:
@@ -111,12 +111,12 @@ public final class AllyDesignationSystem {
|
|||||||
*/
|
*/
|
||||||
public static boolean isValidTarget(Entity attacker, Entity target){
|
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
|
// Always return false if the target is null
|
||||||
if(target == null) return false;
|
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
|
// Tests whether the target is the attacker
|
||||||
if(target == attacker) return false;
|
if(target == attacker) return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user