def formula
This commit is contained in:
@@ -93,13 +93,10 @@ public enum SimulationManager {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if ((_updatePulseTime != 0)
|
if ((_updatePulseTime != 0) && (System.currentTimeMillis() > _updatePulseTime))
|
||||||
&& (System.currentTimeMillis() > _updatePulseTime))
|
|
||||||
pulseUpdate();
|
pulseUpdate();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(
|
Logger.error("Fatal error in Update Pulse: DISABLED");
|
||||||
"Fatal error in Update Pulse: DISABLED");
|
|
||||||
// _runegatePulseTime = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -160,7 +157,11 @@ public enum SimulationManager {
|
|||||||
|
|
||||||
if (player == null)
|
if (player == null)
|
||||||
continue;
|
continue;
|
||||||
player.update(false);
|
try {
|
||||||
|
player.update(true);
|
||||||
|
}catch(Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_updatePulseTime = System.currentTimeMillis() + 500;
|
_updatePulseTime = System.currentTimeMillis() + 500;
|
||||||
|
|||||||
@@ -5037,19 +5037,9 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
@Override
|
@Override
|
||||||
public void update(Boolean newSystem) {
|
public void update(Boolean newSystem) {
|
||||||
|
|
||||||
try {
|
if(!newSystem)
|
||||||
ReentrantReadWriteLock reentrantLock = (ReentrantReadWriteLock) this.updateLock;
|
return;
|
||||||
|
|
||||||
if(reentrantLock.writeLock().isHeldByCurrentThread()){
|
|
||||||
this.updateLock.writeLock().unlock();
|
|
||||||
}
|
|
||||||
// Check if the lock is currently held by another thread (either for reading or writing)
|
|
||||||
if (reentrantLock.isWriteLocked() || reentrantLock.getReadLockCount() > 0) {
|
|
||||||
return; // Or throw an exception if needed
|
|
||||||
}
|
|
||||||
}catch(Exception e){
|
|
||||||
//Logger.error(e);
|
|
||||||
}
|
|
||||||
if (this.updateLock.writeLock().tryLock()) {
|
if (this.updateLock.writeLock().tryLock()) {
|
||||||
try {
|
try {
|
||||||
if (!this.isAlive() && this.isEnteredWorld()) {
|
if (!this.isAlive() && this.isEnteredWorld()) {
|
||||||
@@ -5069,8 +5059,6 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
} else {
|
} else {
|
||||||
this.combatStats.update();
|
this.combatStats.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
//this.doRegen();
|
|
||||||
this.doRegen();
|
this.doRegen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5125,7 +5113,6 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.updateLock.writeLock().unlock();
|
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
} finally {
|
} finally {
|
||||||
this.updateLock.writeLock().unlock();
|
this.updateLock.writeLock().unlock();
|
||||||
|
|||||||
Reference in New Issue
Block a user