Browse Source

Comment and clarity cleanup.

master
MagicBot 2 years ago
parent
commit
e31f320b45
  1. 12
      src/engine/objects/Mine.java
  2. 9
      src/engine/workthreads/HourlyJobThread.java

12
src/engine/objects/Mine.java

@ -20,13 +20,9 @@ package engine.objects;
import engine.Enum; import engine.Enum;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.db.archive.DataWarehouse;
import engine.db.archive.MineRecord;
import engine.gameManager.*; import engine.gameManager.*;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.net.DispatchMessage;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.chat.ChatSystemMsg;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -381,7 +377,11 @@ public class Mine extends AbstractGameObject {
this.buildingID = buildingID; this.buildingID = buildingID;
} }
public static boolean validClaimer(PlayerCharacter playerCharacter) { public static boolean validateClaimer(PlayerCharacter playerCharacter) {
// Method validates that the claimer meets
// all the requirements to claim; landed
// guild with a warehouse, etc.
Guild playerGuild; Guild playerGuild;
@ -491,7 +491,7 @@ public class Mine extends AbstractGameObject {
if (claimer == null) if (claimer == null)
return false; return false;
if (!validClaimer(claimer)) if (!validateClaimer(claimer))
return false; return false;
if (!this.isActive) { if (!this.isActive) {

9
src/engine/workthreads/HourlyJobThread.java

@ -237,8 +237,8 @@ public class HourlyJobThread implements Runnable {
return false; return false;
} }
// Mine building still stands. // Mine building still stands; nothing to do.
// It was never knocked down // We can early exit here.
if (mineBuilding.getRank() > 0) { if (mineBuilding.getRank() > 0) {
mine.setActive(false); mine.setActive(false);
@ -250,16 +250,13 @@ public class HourlyJobThread implements Runnable {
// we will therefore set it to errant // we will therefore set it to errant
// and keep the window open. // and keep the window open.
if (!Mine.validClaimer(mine.lastClaimer)) { if (!Mine.validateClaimer(mine.lastClaimer)) {
mine.lastClaimer = null; mine.lastClaimer = null;
mine.updateGuildOwner(null); mine.updateGuildOwner(null);
mine.setActive(true); mine.setActive(true);
return false; return false;
} }
if (mine.getOwningGuild().isEmptyGuild() || mine.getOwningGuild().getNation().isEmptyGuild())
return false;
//Update ownership to map //Update ownership to map
mine.guildName = mine.getOwningGuild().getName(); mine.guildName = mine.getOwningGuild().getName();

Loading…
Cancel
Save