Add a CanTarget method to lua

This commit is contained in:
abcdefg30
2016-10-04 10:02:18 +02:00
parent 3ac6739a8d
commit 5d2a6ff2e7

View File

@@ -98,5 +98,11 @@ namespace OpenRA.Mods.Common.Scripting
attackBase.AttackTarget(target, true, allowMove, forceAttack);
}
[Desc("Checks if the targeted actor is a valid target for this actor.")]
public bool CanTarget(Actor targetActor)
{
return Target.FromActor(targetActor).IsValidFor(Self);
}
}
}