From 3a771ac585575c6775ab26bb47b7e5cee3bb05d3 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 23 Feb 2024 20:56:08 -0600 Subject: [PATCH] bane cap sized persist through reboots --- src/engine/objects/Bane.java | 3 +++ src/engine/objects/City.java | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/Bane.java b/src/engine/objects/Bane.java index 5f718f35..b074647b 100644 --- a/src/engine/objects/Bane.java +++ b/src/engine/objects/Bane.java @@ -107,6 +107,7 @@ public final class Bane { setDefaultTime(); this.capSize = ZergManager.getBaneCapSize(this.getCity().getGuild()); + this.getCity().setSiegesWithstood(this.capSize); } public static boolean summonBanestone(PlayerCharacter player, ClientConnection origin, int rank) { @@ -268,6 +269,7 @@ public final class Bane { DataWarehouse.pushToWarehouse(baneRecord); bane.capSize = ZergManager.getBaneCapSize(bane.getCity().getGuild()); + bane.getCity().setSiegesWithstood(bane.capSize); return true; } @@ -344,6 +346,7 @@ public final class Bane { newBane = DbManager.BaneQueries.LOAD_BANE(city.getObjectUUID()); newBane.capSize = ZergManager.getBaneCapSize(newBane.getCity().getGuild()); + newBane.getCity().setSiegesWithstood(newBane.capSize); return newBane; } diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index 430c0be5..22b33036 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -323,8 +323,11 @@ public class City extends AbstractWorldObject { writer.putFloat(city.location.z); //writer.putInt(city.siegesWithstood); - writer.putInt(ZergManager.getBaneCapSize(city.getGuild())); - + if(city.getBane() != null) { + writer.putInt(city.siegesWithstood); + } else{ + writer.putInt(ZergManager.getBaneCapSize(city.getGuild())); + } writer.put((byte) 1); writer.put((byte) 0); writer.putInt(0x64);