From 4089f72d8f50281e8def7917f82876189b209daf Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 28 May 2024 22:23:40 -0500 Subject: [PATCH] box flag checker --- src/engine/InterestManagement/InterestManager.java | 4 ++-- src/engine/devcmd/cmds/SetAdminRuneCmd.java | 2 +- src/engine/devcmd/cmds/SetBaseClassCmd.java | 2 +- src/engine/devcmd/cmds/SetLevelCmd.java | 2 +- src/engine/devcmd/cmds/SetPromotionClassCmd.java | 2 +- src/engine/devcmd/cmds/SetRuneCmd.java | 2 +- src/engine/objects/Building.java | 2 +- src/engine/objects/PlayerCharacter.java | 4 ++-- src/engine/workthreads/ZergMechanicThread.java | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/engine/InterestManagement/InterestManager.java b/src/engine/InterestManagement/InterestManager.java index 2a55151d..af8d525c 100644 --- a/src/engine/InterestManagement/InterestManager.java +++ b/src/engine/InterestManagement/InterestManager.java @@ -109,7 +109,7 @@ public enum InterestManager implements Runnable { origin.sendMsg(moveMsg); } - public static void reloadCharacter(AbstractCharacter absChar) { + public static void reloadCharacter(AbstractCharacter absChar, boolean sendToSelf) { UnloadObjectsMsg uom = new UnloadObjectsMsg(); uom.addObject(absChar); @@ -135,7 +135,7 @@ public enum InterestManager implements Runnable { if (cc == null) continue; - if (pcc.getObjectUUID() == absChar.getObjectUUID()) + if (pcc.getObjectUUID() == absChar.getObjectUUID() && !sendToSelf) continue; else { diff --git a/src/engine/devcmd/cmds/SetAdminRuneCmd.java b/src/engine/devcmd/cmds/SetAdminRuneCmd.java index f8df7016..89423d95 100644 --- a/src/engine/devcmd/cmds/SetAdminRuneCmd.java +++ b/src/engine/devcmd/cmds/SetAdminRuneCmd.java @@ -62,7 +62,7 @@ public class SetAdminRuneCmd extends AbstractDevCmd { if (worked) { ChatManager.chatSayInfo(pcSender, "rune of ID " + runeID + " removed"); - InterestManager.reloadCharacter(pcSender); + InterestManager.reloadCharacter(pcSender,false); } else throwbackError(pcSender, "Failed to remove the rune of type " + runeID); diff --git a/src/engine/devcmd/cmds/SetBaseClassCmd.java b/src/engine/devcmd/cmds/SetBaseClassCmd.java index be99f8de..1afc430b 100644 --- a/src/engine/devcmd/cmds/SetBaseClassCmd.java +++ b/src/engine/devcmd/cmds/SetBaseClassCmd.java @@ -47,7 +47,7 @@ public class SetBaseClassCmd extends AbstractDevCmd { this.setTarget(pc); //for logging ChatManager.chatSayInfo(pc, "BaseClass changed to " + classID); - InterestManager.reloadCharacter(pc); + InterestManager.reloadCharacter(pc,false); } diff --git a/src/engine/devcmd/cmds/SetLevelCmd.java b/src/engine/devcmd/cmds/SetLevelCmd.java index df3e2ee2..bf1443d7 100644 --- a/src/engine/devcmd/cmds/SetLevelCmd.java +++ b/src/engine/devcmd/cmds/SetLevelCmd.java @@ -58,7 +58,7 @@ public class SetLevelCmd extends AbstractDevCmd { tar.setLevel((short) level); this.setTarget(tar); //for logging ChatManager.chatSayInfo(pc, tar.getFirstName() + " level changed to " + level); - InterestManager.reloadCharacter(tar); + InterestManager.reloadCharacter(tar,false); } @Override diff --git a/src/engine/devcmd/cmds/SetPromotionClassCmd.java b/src/engine/devcmd/cmds/SetPromotionClassCmd.java index f8776786..0cab5b71 100644 --- a/src/engine/devcmd/cmds/SetPromotionClassCmd.java +++ b/src/engine/devcmd/cmds/SetPromotionClassCmd.java @@ -42,7 +42,7 @@ public class SetPromotionClassCmd extends AbstractDevCmd { pc.setPromotionClass(classID); ChatManager.chatSayInfo(pc, "PromotionClass changed to " + classID); - InterestManager.reloadCharacter(pc); + InterestManager.reloadCharacter(pc,false); this.setTarget(pc); //for logging diff --git a/src/engine/devcmd/cmds/SetRuneCmd.java b/src/engine/devcmd/cmds/SetRuneCmd.java index 1379ab35..0f477129 100644 --- a/src/engine/devcmd/cmds/SetRuneCmd.java +++ b/src/engine/devcmd/cmds/SetRuneCmd.java @@ -57,7 +57,7 @@ public class SetRuneCmd extends AbstractDevCmd { if (worked) { ChatManager.chatSayInfo(pcSender, "rune of ID " + runeID + " removed"); - InterestManager.reloadCharacter(pcSender); + InterestManager.reloadCharacter(pcSender,false); } else throwbackError(pcSender, "Failed to remove the rune of type " + runeID); diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index 71c883da..df8e2227 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -435,7 +435,7 @@ public class Building extends AbstractWorldObject { int index = 0; for (AbstractCharacter hireling : this.hirelings.keySet()) { hireling.setLoc(BuildingManager._slotLocations.get(newMeshUUID).get(index).getLocation()); - InterestManager.reloadCharacter(hireling); + InterestManager.reloadCharacter(hireling,false); } } } diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 03ea9676..9c70d5a6 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -4876,7 +4876,7 @@ public class PlayerCharacter extends AbstractCharacter { if (this.isBoxed) { if (this.title.equals(CharacterTitle.BOX) == false) { this.title = CharacterTitle.BOX; - InterestManager.reloadCharacter(this); + InterestManager.reloadCharacter(this,true); } if (this.containsEffect(1672601862) == false) {//Deathshroud PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); @@ -4884,7 +4884,7 @@ public class PlayerCharacter extends AbstractCharacter { } else { if (this.title.equals(CharacterTitle.NONE) == false) { this.title = CharacterTitle.NONE; - InterestManager.reloadCharacter(this); + InterestManager.reloadCharacter(this,true); } } } diff --git a/src/engine/workthreads/ZergMechanicThread.java b/src/engine/workthreads/ZergMechanicThread.java index 27cb9493..043e3e4e 100644 --- a/src/engine/workthreads/ZergMechanicThread.java +++ b/src/engine/workthreads/ZergMechanicThread.java @@ -85,7 +85,7 @@ import java.util.HashSet; } private void RunBaneMechanic() { - while (bane.getSiegePhase().equals(Enum.SiegePhase.WAR)) { + while (bane != null && bane.getSiegePhase().equals(Enum.SiegePhase.WAR)) { HashSet currentPlayers = WorldGrid.getObjectsInRangePartial(bane.getCity().loc, Enum.CityBoundsType.GRID.extents * 2.0f, MBServerStatics.MASK_PLAYER); Guild attacker = bane.getStone().getGuild().getNation(); Guild defender = bane.getCity().getGuild().getNation();