Fix HE grenades doing damage to teammates if the thrower died

This commit is contained in:
Spencer 2017-12-31 22:15:11 -05:00 committed by Alexander Meech
parent 11e6660809
commit be72f7ea90
1 changed files with 15 additions and 0 deletions

View File

@ -44,13 +44,28 @@ public class HighExplosive extends Grenade
ent.getWorld().playSound(ent.getLocation(),
Sound.EXPLODE, 3f, 0.8f);
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 9);
List<Player> damagedPlayers = new ArrayList<>();
GameTeam throwerTeam = game.getHost().GetTeam(_thrower);
for (Player player : players.keySet())
{
if (!game.getHost().IsAlive(player))
continue;
if (throwerTeam != null && !_thrower.equals(player))
{
GameTeam damagedTeam = game.getHost().GetTeam(player);
if (damagedTeam != null && throwerTeam.equals(damagedTeam))
{
continue;
}
}
// Damage Event
Player damager = null;
if (game.getHost().IsAlive(_thrower))