Fixed snowman turret targeting team mates

This commit is contained in:
xGamingDudex 2016-10-20 01:27:22 +02:00
parent 82f1ec1ac6
commit 74d6c599b5
1 changed files with 6 additions and 4 deletions

View File

@ -106,7 +106,7 @@ public class SmashSnowman extends SmashUltimate
{
Snowman snowman = turretIter.next();
Player player = _turret.get(snowman);
Player target = UtilPlayer.getClosest(snowman.getLocation(), player);
Player target = UtilPlayer.getClosest(snowman.getLocation(), Manager.GetGame().GetTeam(player).GetPlayers(true));
if (target == null)
{
@ -150,8 +150,10 @@ public class SmashSnowman extends SmashUltimate
{
return;
}
Player damager = _snowball.get(proj);
if (!_snowball.containsKey(proj))
if (damager == null)
{
return;
}
@ -165,7 +167,7 @@ public class SmashSnowman extends SmashUltimate
event.SetCancelled("Turret");
if (damagee.equals(_snowball.get(proj)))
if(Manager.GetGame().GetTeam(damager).GetPlayers(true).contains(damagee))
{
return;
}
@ -183,7 +185,7 @@ public class SmashSnowman extends SmashUltimate
return;
}
Manager.GetDamage().NewDamageEvent(damagee, _snowball.get(proj), null, DamageCause.PROJECTILE, 2, false, true, false, UtilEnt.getName(_snowball.get(proj)), GetName());
Manager.GetDamage().NewDamageEvent(damagee, damager, null, DamageCause.PROJECTILE, 2, false, true, false, UtilEnt.getName(_snowball.get(proj)), GetName());
}
@EventHandler