Faction homes are now un-set if the territory they are set in is lost (unclaimed, or claimed by another faction), but only when someone tries to /f home or dies and would normally respawn there

This commit is contained in:
Brettflan 2011-06-30 05:17:34 -05:00
parent 8f9de1d2d5
commit 24e85e0e77

View File

@ -95,13 +95,24 @@ public class Faction {
}
public Location getHome() {
confirmValidHome();
return home;
}
public boolean hasHome() {
confirmValidHome();
return this.home != null;
}
public void confirmValidHome() {
if (!Conf.homesMustBeInClaimedTerritory || Board.getFactionAt(new FLocation(this.home)) == this) {
return;
}
sendMessage("Your faction home has been un-set since it is no longer in your territory.");
this.home = null;
}
// -------------------------------
// Understand the types
// -------------------------------