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)
This commit is contained in:
parent
7aa4fa12f2
commit
f65f3a0e9e
@ -293,7 +293,7 @@ public class FactionsEntityListener implements Listener
|
|||||||
Rel relation = defendFaction.getRelationTo(attackFaction);
|
Rel relation = defendFaction.getRelationTo(attackFaction);
|
||||||
|
|
||||||
// Check the relation
|
// 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("<i>You can't hurt %s<i>.", relation.getDescPlayerMany());
|
if (notify) attacker.msg("<i>You can't hurt %s<i>.", relation.getDescPlayerMany());
|
||||||
return false;
|
return false;
|
||||||
@ -312,7 +312,7 @@ public class FactionsEntityListener implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Damage will be dealt. However check if the damage should be reduced.
|
// 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));
|
int newDamage = (int)Math.ceil(damage * (1D - Conf.territoryShieldFactor));
|
||||||
sub.setDamage(newDamage);
|
sub.setDamage(newDamage);
|
||||||
|
Loading…
Reference in New Issue
Block a user