From e31f320b455600492895a5c74bb426b390fb8d74 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 21 Jan 2023 12:52:52 -0500 Subject: [PATCH] Comment and clarity cleanup. --- src/engine/objects/Mine.java | 12 ++++++------ src/engine/workthreads/HourlyJobThread.java | 9 +++------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index fe7a8d6d..132700c0 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -20,13 +20,9 @@ package engine.objects; import engine.Enum; import engine.InterestManagement.WorldGrid; -import engine.db.archive.DataWarehouse; -import engine.db.archive.MineRecord; import engine.gameManager.*; import engine.net.ByteBufferWriter; -import engine.net.DispatchMessage; import engine.net.client.msg.ErrorPopupMsg; -import engine.net.client.msg.chat.ChatSystemMsg; import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; @@ -381,7 +377,11 @@ public class Mine extends AbstractGameObject { 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; @@ -491,7 +491,7 @@ public class Mine extends AbstractGameObject { if (claimer == null) return false; - if (!validClaimer(claimer)) + if (!validateClaimer(claimer)) return false; if (!this.isActive) { diff --git a/src/engine/workthreads/HourlyJobThread.java b/src/engine/workthreads/HourlyJobThread.java index 58562e8d..c5de4218 100644 --- a/src/engine/workthreads/HourlyJobThread.java +++ b/src/engine/workthreads/HourlyJobThread.java @@ -237,8 +237,8 @@ public class HourlyJobThread implements Runnable { return false; } - // Mine building still stands. - // It was never knocked down + // Mine building still stands; nothing to do. + // We can early exit here. if (mineBuilding.getRank() > 0) { mine.setActive(false); @@ -250,16 +250,13 @@ public class HourlyJobThread implements Runnable { // we will therefore set it to errant // and keep the window open. - if (!Mine.validClaimer(mine.lastClaimer)) { + if (!Mine.validateClaimer(mine.lastClaimer)) { mine.lastClaimer = null; mine.updateGuildOwner(null); mine.setActive(true); return false; } - if (mine.getOwningGuild().isEmptyGuild() || mine.getOwningGuild().getNation().isEmptyGuild()) - return false; - //Update ownership to map mine.guildName = mine.getOwningGuild().getName();