forked from MagicBane/Server
Prior claims are released upon a new claim.
This commit is contained in:
@@ -128,6 +128,17 @@ public class Mine extends AbstractGameObject {
|
||||
|
||||
}
|
||||
|
||||
public static void releaseMineClaims(PlayerCharacter playerCharacter) {
|
||||
|
||||
for (Mine mine : Mine.getMines()) {
|
||||
|
||||
if (mine.lastClaimer.equals(playerCharacter)) {
|
||||
mine.lastClaimer = null;
|
||||
mine.updateGuildOwner(null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public static void SendMineAttackMessage(Building mine) {
|
||||
|
||||
if (mine.getBlueprint() == null)
|
||||
@@ -561,7 +572,6 @@ public class Mine extends AbstractGameObject {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean depositMineResources() {
|
||||
|
||||
if (this.owningGuild.isErrant())
|
||||
@@ -664,7 +674,6 @@ public class Mine extends AbstractGameObject {
|
||||
}
|
||||
}
|
||||
return (int) totalModded;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ public class ClaimMinePowerAction extends AbstractPowerAction {
|
||||
if (mine == null)
|
||||
return;
|
||||
|
||||
// Release prior claims
|
||||
|
||||
Mine.releaseMineClaims(playerCharacter);
|
||||
|
||||
if (mine.claimMine(playerCharacter) == true)
|
||||
ChatManager.sendSystemMessage( (PlayerCharacter) source, "You successfully claimed this mine..");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user