attempted invis character sync fix
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user