New conf.json option "homesTeleportIgnoreEnemiesIfInOwnTerritory" (default true). If disabled, players will no longer be able to teleport to their faction home while close to an enemy even if they are in their own territory

This commit is contained in:
Brettflan
2011-07-20 15:45:36 -05:00
parent 66bc427454
commit 5b73ebc456
2 changed files with 6 additions and 1 deletions

View File

@ -57,7 +57,11 @@ public class FCommandHome extends FBaseCommand {
Faction faction = Board.getFactionAt(new FLocation(player.getLocation()));
// if player is not in a safe zone or their own faction territory, only allow teleport if no enemies are nearby
if (Conf.homesTeleportAllowedEnemyDistance > 0 && ! faction.isSafeZone() && ! me.isInOwnTerritory()) {
if (
Conf.homesTeleportAllowedEnemyDistance > 0
&& !faction.isSafeZone()
&& (!me.isInOwnTerritory() || (me.isInOwnTerritory() && !Conf.homesTeleportIgnoreEnemiesIfInOwnTerritory))
) {
Location loc = player.getLocation();
World w = loc.getWorld();
double x = loc.getX();