diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index ec78bb26..d24c7401 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -62,6 +62,8 @@ public class Mine extends AbstractGameObject { public int liveTime; + public int liveLength = 3600; + public static ArrayList ChinaMines = new ArrayList<>(); public static ArrayList EuroMines = new ArrayList<>(); public static ArrayList AmericaMines = new ArrayList<>(); @@ -278,7 +280,7 @@ public class Mine extends AbstractGameObject { writer.putInt(mine.production.hash); writer.putInt(mine.getModifiedProductionAmount()); writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here - writer.putInt(3600); //window in seconds + writer.putInt(mine.liveLength); //window in seconds // Errant mines are currently open. Set time to now. @@ -299,7 +301,11 @@ public class Mine extends AbstractGameObject { mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).withNano(0); writer.putLocalDateTime(mineOpenTime); - writer.putLocalDateTime(mineOpenTime.plusHours(1)); + if(mine.liveLength == 3600) { + writer.putLocalDateTime(mineOpenTime.plusHours(1)); + } else{ + writer.putLocalDateTime(mineOpenTime.plusMinutes(30)); + } writer.put(mine.isActive ? (byte) 0x01 : (byte) 0x00); Building mineTower = BuildingManager.getBuilding(mine.buildingID);