From 79d05f1fb2c84e856ce4f761bae5dbb4336be221 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 19 Jan 2023 13:59:52 -0500 Subject: [PATCH] Serialize current time for all active mines regardless of claim status. --- src/engine/objects/Mine.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 64b340d7..42b1d9ef 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -269,15 +269,17 @@ public class Mine extends AbstractGameObject { writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here writer.putInt(3600); //window in seconds - // Errant mines are currently open. Set time to now. + // Errant mines are currently open. Set time to now. LocalDateTime mineOpenTime = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0); Guild mineOwnerGuild = mine.getOwningGuild(); // Adjust the serialized mine time based upon whether // the Guild's mine window has passed or not. + // If a mine is active serialize current datetime irrespective + // of any claim - if (mineOwnerGuild.isErrant() == false) { + if (mineOwnerGuild.isErrant() == false && mine.isActive == false) { int guildWOO = mineOwnerGuild.getMineTime(); LocalDateTime guildMineTime = mineOpenTime.withHour(guildWOO); @@ -287,11 +289,6 @@ public class Mine extends AbstractGameObject { else mineOpenTime = guildMineTime; - // If a mine is active serialize current datetime irrespective - // of any claim - - if (mine.isActive == true) - mineOpenTime = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0); }