Fix HE grenades doing damage to teammates if the thrower died
This commit is contained in:
parent
11e6660809
commit
be72f7ea90
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue