From b53f2c282466a7f6021d43fe36944e68a8ff1f19 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 2 Mar 2024 16:35:00 -0600 Subject: [PATCH] combat bug fix --- .../InterestManagement/InterestManager.java | 13 ----------- src/engine/objects/PlayerCharacter.java | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/engine/InterestManagement/InterestManager.java b/src/engine/InterestManagement/InterestManager.java index 178e8b33..6de6a458 100644 --- a/src/engine/InterestManagement/InterestManager.java +++ b/src/engine/InterestManagement/InterestManager.java @@ -539,19 +539,6 @@ public enum InterestManager implements Runnable { player.getCharItemManager().updateInventory(); } player.isBoxed = false; - for(PlayerCharacter pc : SessionManager.getAllActivePlayers()){ - if(pc.isActive() == false) - continue; - if(pc.isEnteredWorld() == false) - continue; - if(origin.machineID.equals(pc.getClientConnection().machineID)){ - //add deatshroud effect - if(pc.isBoxed == true) - continue; - player.isBoxed = true; - return; - } - } } diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index d2da7901..e1563f6c 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -4817,6 +4817,10 @@ public class PlayerCharacter extends AbstractCharacter { this.safeZone = this.isInSafeZone(); + if(this.isBoxed == false){ + this. isBoxed = checkIfBoxed(this); + } + if(this.isBoxed && this.containsEffect(1672601862) == false) {//Deathshroud PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); } @@ -4832,6 +4836,24 @@ public class PlayerCharacter extends AbstractCharacter { } } + public static boolean checkIfBoxed(PlayerCharacter player){ + for(PlayerCharacter pc : SessionManager.getAllActivePlayers()){ + if(pc.isBoxed) + continue; + + if(!pc.isActive) + continue; + + if(!pc.enteredWorld) + continue; + + if(pc.getClientConnection().machineID.equals(player.getClientConnection().machineID) && pc.isBoxed == true) + continue; + return true; + } + return false; + } + @Override public void updateFlight() {