def formula
This commit is contained in:
@@ -93,13 +93,10 @@ public enum SimulationManager {
|
||||
}
|
||||
try {
|
||||
|
||||
if ((_updatePulseTime != 0)
|
||||
&& (System.currentTimeMillis() > _updatePulseTime))
|
||||
if ((_updatePulseTime != 0) && (System.currentTimeMillis() > _updatePulseTime))
|
||||
pulseUpdate();
|
||||
} catch (Exception e) {
|
||||
Logger.error(
|
||||
"Fatal error in Update Pulse: DISABLED");
|
||||
// _runegatePulseTime = 0;
|
||||
Logger.error("Fatal error in Update Pulse: DISABLED");
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -160,7 +157,11 @@ public enum SimulationManager {
|
||||
|
||||
if (player == null)
|
||||
continue;
|
||||
player.update(false);
|
||||
try {
|
||||
player.update(true);
|
||||
}catch(Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
_updatePulseTime = System.currentTimeMillis() + 500;
|
||||
|
||||
@@ -5037,19 +5037,9 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
@Override
|
||||
public void update(Boolean newSystem) {
|
||||
|
||||
try {
|
||||
ReentrantReadWriteLock reentrantLock = (ReentrantReadWriteLock) this.updateLock;
|
||||
if(!newSystem)
|
||||
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()) {
|
||||
try {
|
||||
if (!this.isAlive() && this.isEnteredWorld()) {
|
||||
@@ -5069,8 +5059,6 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
} else {
|
||||
this.combatStats.update();
|
||||
}
|
||||
|
||||
//this.doRegen();
|
||||
this.doRegen();
|
||||
}
|
||||
|
||||
@@ -5125,7 +5113,6 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
this.updateLock.writeLock().unlock();
|
||||
Logger.error(e);
|
||||
} finally {
|
||||
this.updateLock.writeLock().unlock();
|
||||
|
||||
Reference in New Issue
Block a user