diff --git a/src/main/java/electroblob/wizardry/spell/MindControl.java b/src/main/java/electroblob/wizardry/spell/MindControl.java index e061d180..fea21f2a 100644 --- a/src/main/java/electroblob/wizardry/spell/MindControl.java +++ b/src/main/java/electroblob/wizardry/spell/MindControl.java @@ -203,11 +203,11 @@ public class MindControl extends Spell { Entity caster = WizardryUtilities.getEntityByUUID(world, entityNBT.getUniqueId(MindControl.NBT_KEY)); - // If the current target is already a valid mind control target, nothing happens. - if(WizardryUtilities.isValidTarget(caster, currentTarget)) return; - if(caster instanceof EntityLivingBase){ + // If the current target is already a valid mind control target, nothing happens. + if(WizardryUtilities.isValidTarget(caster, currentTarget)) return; + if(MindControl.findMindControlTarget(entity, (EntityLivingBase)caster, world)){ // If it worked, skip setting the target to null. return; diff --git a/src/main/java/electroblob/wizardry/util/WizardryUtilities.java b/src/main/java/electroblob/wizardry/util/WizardryUtilities.java index 1b18fe79..e919603c 100644 --- a/src/main/java/electroblob/wizardry/util/WizardryUtilities.java +++ b/src/main/java/electroblob/wizardry/util/WizardryUtilities.java @@ -942,7 +942,7 @@ public final class WizardryUtilities { * * @return False under any of the following circumstances, true otherwise: *

- * - Either entity is null + * - The target is null *

* - The target is the attacker (this isn't as stupid as it sounds - anything with an AoE might cause this * to be true, as can summoned creatures) @@ -951,10 +951,18 @@ public final class WizardryUtilities { * attacker need not be an ally of the target) *

* - The target is a creature that was summoned/controlled by the attacker or by an ally of the attacker. + *

+ * As of wizardry 4.1.2, this method now returns true instead of false if the attacker is null. This + * is because in the vast majority of cases, it makes more sense this way: if a construct has no caster, it + * should affect all entities; if a minion has no caster is should target all entities; etc. */ public static boolean isValidTarget(Entity attacker, Entity target){ - if(attacker == null || target == null) return false; + // 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; // Tests whether the target is the attacker if(target == attacker) return false;