Don't include teammates in Mass Electrocution counter (PC-1647)

This commit is contained in:
ArcticZeroo 2017-10-21 23:52:30 -04:00 committed by Alexander Meech
parent 7e4d6c4320
commit 924e0b6fda

View File

@ -6,6 +6,7 @@ import java.util.List;
import mineplex.minecraft.game.classcombat.Skill.Mage.LightningOrb.LightningOrbEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -25,12 +26,22 @@ public class ElectrocutionStatTracker extends StatTracker<Game>
return;
List<Player> viable = new ArrayList<Player>();
GameTeam playerTeam = getGame().GetTeam(event.getPlayer());
for (LivingEntity en : event.getStruck())
{
if (en instanceof Player)
{
viable.add((Player) en);
Player struckPlayer = (Player) en;
GameTeam struckTeam = getGame().GetTeam(struckPlayer);
if (struckTeam != null && playerTeam != null && struckTeam != playerTeam) {
continue;
}
viable.add(struckPlayer);
}
}