From f65f3a0e9e5816a4fe47de7e9fd0c6b20f9a22ef Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 26 Aug 2012 18:48:49 -0500 Subject: [PATCH] Fix for factionless players being unable to hurt each other, and fix for factionless players taking reduced damage in Wilderness (was being treated as their faction territory by damage reduction routine) --- .../factions/listeners/FactionsEntityListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java index 2d81371e..db3e3e60 100644 --- a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -293,7 +293,7 @@ public class FactionsEntityListener implements Listener Rel relation = defendFaction.getRelationTo(attackFaction); // Check the relation - if (relation.isAtLeast(Conf.friendlyFireFromRel) && defLocFaction.getFlag(FFlag.FRIENDLYFIRE) == false) + if (defender.hasFaction() && relation.isAtLeast(Conf.friendlyFireFromRel) && defLocFaction.getFlag(FFlag.FRIENDLYFIRE) == false) { if (notify) attacker.msg("You can't hurt %s.", relation.getDescPlayerMany()); return false; @@ -312,7 +312,7 @@ public class FactionsEntityListener implements Listener } // Damage will be dealt. However check if the damage should be reduced. - if (damage > 0.0 && ownTerritory && Conf.territoryShieldFactor > 0) + if (damage > 0.0 && defender.hasFaction() && ownTerritory && Conf.territoryShieldFactor > 0) { int newDamage = (int)Math.ceil(damage * (1D - Conf.territoryShieldFactor)); sub.setDamage(newDamage);