New conf.json option "claimsCanBeUnconnectedIfOwnedByOtherFaction" (default true) which, will allow claims to bypass the "claimsMustBeConnected" option if the attempted claim is vulnerable land controlled by another faction

This commit is contained in:
Brettflan 2011-07-20 14:45:18 -05:00
parent 5686c4db9d
commit 16053d0008
2 changed files with 11 additions and 2 deletions

View File

@ -73,6 +73,7 @@ public class Conf {
public static int noPVPDamageToOthersForXSecondsAfterLogin = 3;
public static boolean claimsMustBeConnected = false;
public static boolean claimsCanBeUnconnectedIfOwnedByOtherFaction = true;
public static double considerFactionsReallyOfflineAfterXMinutes = 0;

View File

@ -503,7 +503,15 @@ public class FPlayer {
return false;
}
if (Conf.claimsMustBeConnected && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.isConnectedLocation(flocation, myFaction)) {
if (
Conf.claimsMustBeConnected
&& myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0
&& !Board.isConnectedLocation(flocation, myFaction)
&& (!Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction || !otherFaction.isNormal())
) {
if (Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction)
sendMessage("You can only claim additional land which is connected to your first claim or controlled by another faction!");
else
sendMessage("You can only claim additional land which is connected to your first claim!");
return false;
}