diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 5cdab19b..bb045c28 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -470,25 +470,27 @@ public enum CombatManager { //Range check. - if(abstractCharacter.isMoving()){ - range += (abstractCharacter.getSpeed() * 0.1f); // add movement vector offset for moving attacker - } - - if(AbstractWorldObject.IsAbstractCharacter(target)) { - AbstractCharacter tarAc = (AbstractCharacter) target; - if(tarAc != null && tarAc.isMoving()){ - range += (tarAc.getSpeed() * 0.1f); // add movement vector offset for moving target - } - } - - float attackerHitBox = abstractCharacter.calcHitBox(); // add attacker hitbox - float targetHitBox = 0.0f; - if(AbstractCharacter.IsAbstractCharacter(target)){ - AbstractCharacter targetCharacter = (AbstractCharacter)target; - targetHitBox = targetCharacter.calcHitBox(); // add target hitbox - } - - range += attackerHitBox + targetHitBox + 2.5f; // offset standard range to sync where client tries to stop + //if(abstractCharacter.isMoving()){ + // range += (abstractCharacter.getSpeed() * 0.1f); // add movement vector offset for moving attacker + //} + + //if(AbstractWorldObject.IsAbstractCharacter(target)) { + // AbstractCharacter tarAc = (AbstractCharacter) target; + // if(tarAc != null && tarAc.isMoving()){ + // range += (tarAc.getSpeed() * 0.1f); // add movement vector offset for moving target + // } + //} + + //float attackerHitBox = abstractCharacter.calcHitBox(); // add attacker hitbox + //float targetHitBox = 0.0f; + //if(AbstractCharacter.IsAbstractCharacter(target)){ + // AbstractCharacter targetCharacter = (AbstractCharacter)target; + // targetHitBox = targetCharacter.calcHitBox(); // add target hitbox + //} + + //range += attackerHitBox + targetHitBox + 2.5f; // offset standard range to sync where client tries to stop + + range += 2; //sync offset if (NotInRange(abstractCharacter, target, range)) { diff --git a/src/engine/gameManager/SimulationManager.java b/src/engine/gameManager/SimulationManager.java index 62022cc0..6044d8f7 100644 --- a/src/engine/gameManager/SimulationManager.java +++ b/src/engine/gameManager/SimulationManager.java @@ -91,13 +91,13 @@ public enum SimulationManager { "Fatal error in City Pulse: DISABLED. Error Message : " + e.getMessage()); } - try { + //try { - if ((_updatePulseTime != 0) && (System.currentTimeMillis() > _updatePulseTime)) - pulseUpdate(); - } catch (Exception e) { - Logger.error("Fatal error in Update Pulse: DISABLED"); - } + // if ((_updatePulseTime != 0) && (System.currentTimeMillis() > _updatePulseTime)) + // pulseUpdate(); + //} catch (Exception e) { + // Logger.error("Fatal error in Update Pulse: DISABLED"); + //} try { if ((_runegatePulseTime != 0) diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 1ea2fa12..d5bc038a 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -5155,13 +5155,13 @@ public class PlayerCharacter extends AbstractCharacter { if (this.updateLock.writeLock().tryLock()) { - if(!this.timestamps.containsKey("SetDirty")){ - this.timestamps.put("SetDirty", System.currentTimeMillis()); - }else if (this.timestamps.get("SetDirty") + 5000L < System.currentTimeMillis()){ - InterestManager.setObjectDirty(this); - InterestManager.reloadCharacter(this,false); - this.timestamps.put("SetDirty", System.currentTimeMillis()); - } + //if(!this.timestamps.containsKey("SetDirty")){ + // this.timestamps.put("SetDirty", System.currentTimeMillis()); + //}else if (this.timestamps.get("SetDirty") + 5000L < System.currentTimeMillis()){ + // InterestManager.setObjectDirty(this); + // InterestManager.reloadCharacter(this,false); + // this.timestamps.put("SetDirty", System.currentTimeMillis()); + //} try { diff --git a/src/engine/workthreads/UpdateThread.java b/src/engine/workthreads/UpdateThread.java index 86b3ff80..94c7f0bc 100644 --- a/src/engine/workthreads/UpdateThread.java +++ b/src/engine/workthreads/UpdateThread.java @@ -47,7 +47,7 @@ public class UpdateThread implements Runnable { while (true) { try { this.processPlayerUpdate(); - Thread.sleep(100); // Pause for 100ms to reduce CPU usage + Thread.sleep(1000); // Pause for 1000ms to reduce CPU usage } catch (InterruptedException e) { Logger.error("Thread interrupted", e); }