Finish TargetCancel inside PerkSkeleton
Should prevent skeletons from attacking teammates
This commit is contained in:
parent
fa72dc60dd
commit
131369cebe
@ -160,9 +160,21 @@ public class PerkSkeletons extends Perk
|
||||
{
|
||||
if (event.getEntity().equals(skel))
|
||||
{
|
||||
// Cancel targeting when the skeleton
|
||||
// needs to return home
|
||||
if (UtilMath.offset(skel, player) > _maxDist)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
if (event.getTarget() instanceof Player)
|
||||
{
|
||||
Player target = (Player) event.getTarget();
|
||||
|
||||
if (Manager.GetGame().GetTeam(player) == Manager.GetGame().GetTeam(target))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -190,13 +202,15 @@ public class PerkSkeletons extends Perk
|
||||
continue;
|
||||
}
|
||||
|
||||
//Return to Owner
|
||||
double range = 4;
|
||||
|
||||
//If it's targeting another player
|
||||
if (skel.getTarget() != null || ((CraftSkeleton) skel).getHandle().getGoalTarget() != null)
|
||||
{
|
||||
range = _maxDist;
|
||||
}
|
||||
|
||||
//Return to Owner
|
||||
if (UtilMath.offset(skel, player) > range)
|
||||
{
|
||||
float speed = 1.25f;
|
||||
|
Loading…
Reference in New Issue
Block a user