PlayerCombatStats proper delays

This commit is contained in:
2025-01-22 16:05:01 -06:00
parent 09af8084b9
commit 030d1110b9
2 changed files with 12 additions and 7 deletions
-7
View File
@@ -5108,13 +5108,6 @@ public class PlayerCharacter extends AbstractCharacter {
}
if(this.isAlive() && this.isActive && this.enteredWorld) {
if (this.combatStats == null) {
this.combatStats = new PlayerCombatStats(this);
}
PlayerCombatStats cStats = this.combatStats;
cStats.update();
}
} catch (Exception e) {
Logger.error(e);
} finally {
+12
View File
@@ -14,6 +14,7 @@ import engine.gameManager.SessionManager;
import engine.gameManager.SimulationManager;
import engine.objects.Bane;
import engine.objects.PlayerCharacter;
import engine.objects.PlayerCombatStats;
import org.pmw.tinylog.Logger;
public class UpdateThread implements Runnable {
@@ -32,6 +33,17 @@ public class UpdateThread implements Runnable {
for(PlayerCharacter player : SessionManager.getAllActivePlayerCharacters()){
if (player != null) {
player.doRegen();
try {
if (player.isAlive() && player.isActive() && player.isEnteredWorld()) {
if (player.combatStats == null) {
player.combatStats = new PlayerCombatStats(player);
}
PlayerCombatStats cStats = player.combatStats;
cStats.update();
}
}catch(Exception e){
}
}
}
} catch (Exception e) {