From 85fd5eb04d5ee4a54de9be5c3cad6a464c1ade3a Mon Sep 17 00:00:00 2001 From: Brettflan Date: Wed, 8 Jun 2011 16:22:19 -0500 Subject: [PATCH] Fix for options which disable wilderness explosions (TNT, creepers, fireballs) not actually disabling them; player->player damage is now also prevented if attacker is in a safe zone and defender is not (attacking from safety that way was exploity) --- .../factions/listeners/FactionsEntityListener.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/org/mcteam/factions/listeners/FactionsEntityListener.java b/src/org/mcteam/factions/listeners/FactionsEntityListener.java index 90dd9898..7207e065 100644 --- a/src/org/mcteam/factions/listeners/FactionsEntityListener.java +++ b/src/org/mcteam/factions/listeners/FactionsEntityListener.java @@ -94,11 +94,6 @@ public class FactionsEntityListener extends EntityListener { Faction faction = Board.getFactionAt(new FLocation(event.getLocation())); - // Explosions may happen in the wilderness - if (faction.isNone()) { - return; - } - if (event.getEntity() instanceof Creeper && ( (faction.isNone() && Conf.wildernessBlockCreepers) || (faction.isNormal() && Conf.territoryBlockCreepers) || @@ -161,6 +156,12 @@ public class FactionsEntityListener extends EntityListener { return true; } + // so we know from above that the defender isn't in a safezone... what about the attacker, sneaky dog that he might be? + if (Board.getFactionAt(new FLocation(attacker)).isSafeZone()) { + attacker.sendMessage("You can't hurt other players while you are in a SafeZone."); + return false; + } + Relation relation = defender.getRelation(attacker); // Players without faction may be hurt anywhere