attempted invis character sync fix

This commit is contained in:
2025-03-15 13:20:57 -05:00
parent 49ce99fd58
commit dd2707f6fb
4 changed files with 32 additions and 30 deletions
+18 -16
View File
@@ -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(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
}
}
//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
}
//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 += attackerHitBox + targetHitBox + 2.5f; // offset standard range to sync where client tries to stop
range += 2; //sync offset
if (NotInRange(abstractCharacter, target, range)) {
@@ -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)
+7 -7
View File
@@ -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 {
+1 -1
View File
@@ -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);
}