Fixed an issue where players could hit team members with Bouncy Bacon
and get the health bonus from it.
This commit is contained in:
Sam 2016-06-18 00:04:03 +01:00
parent 09957c203b
commit c19af4e1c5
1 changed files with 13 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.games.smash.TeamSuperSmash;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkPigBaconBounce extends SmashPerk implements IThrown
@ -108,6 +109,18 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
if (target == null)
return;
if (Manager.GetGame() instanceof TeamSuperSmash && target instanceof Player && data.GetThrower() instanceof Player)
{
TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame();
Player targetPlayer = (Player) target;
Player throwerPlayer = (Player) data.GetThrower();
if(smash.GetTeam(targetPlayer).equals(smash.GetTeam(throwerPlayer)))
{
return;
}
}
//Damage Event
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,