From f51bfc6d2b310ad6bbd9e0388ebb9ce76186497f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 20 Jan 2023 07:57:42 -0500 Subject: [PATCH] Mines can only be claimed once a cycle. --- src/engine/objects/Mine.java | 3 +++ src/engine/workthreads/HourlyJobThread.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index f5b2fefb..d772603c 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -46,6 +46,8 @@ public class Mine extends AbstractGameObject { private String zoneName; private Resource production; private boolean isActive = false; + + public boolean wasClaimed = false; private float latitude; private float longitude; private float altitude; @@ -526,6 +528,7 @@ public class Mine extends AbstractGameObject { mineBuilding.setRank(mineBuilding.getRank()); this.lastClaimer = null; this.setActive(false); + this.wasClaimed = true; return true; } diff --git a/src/engine/workthreads/HourlyJobThread.java b/src/engine/workthreads/HourlyJobThread.java index 2df906b8..d5d92c28 100644 --- a/src/engine/workthreads/HourlyJobThread.java +++ b/src/engine/workthreads/HourlyJobThread.java @@ -103,6 +103,11 @@ public class HourlyJobThread implements Runnable { for (Mine mine : mines) { try { + // Mines can only be claimed once a cycle + + if (mine.wasClaimed == true) + continue;; + // Open Errant Mines if (mine.getOwningGuild().isErrant()) {