Don't include teammates in Mass Electrocution counter (PC-1647)
This commit is contained in:
parent
7e4d6c4320
commit
924e0b6fda
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user