mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-02 03:15:52 -04:00
fixed #337 and removed some lock contention
This commit is contained in:
@@ -123,21 +123,17 @@ public class PlayerService implements INetworkDispatch {
|
||||
}, 30, 30, TimeUnit.SECONDS);
|
||||
|
||||
scheduler.scheduleAtFixedRate(() -> {
|
||||
synchronized(creature.getMutex()) {
|
||||
if(creature.getAction() < creature.getMaxAction() && creature.getPosture() != 14) {
|
||||
if(creature.getCombatFlag() == 0)
|
||||
creature.setAction(creature.getAction() + (15 + creature.getLevel() * 5));
|
||||
else
|
||||
creature.setAction(creature.getAction() + ((15 + creature.getLevel() * 5) / 2));
|
||||
}
|
||||
if(creature.getAction() < creature.getMaxAction() && creature.getPosture() != 14) {
|
||||
if(creature.getCombatFlag() == 0)
|
||||
creature.setAction(creature.getAction() + (15 + creature.getLevel() * 5));
|
||||
else
|
||||
creature.setAction(creature.getAction() + ((15 + creature.getLevel() * 5) / 2));
|
||||
}
|
||||
}, 0, 1000, TimeUnit.MILLISECONDS);
|
||||
|
||||
scheduler.scheduleAtFixedRate(() -> {
|
||||
synchronized(creature.getMutex()) {
|
||||
if(creature.getHealth() < creature.getMaxHealth() && creature.getCombatFlag() == 0 && creature.getPosture() != 13 && creature.getPosture() != 14)
|
||||
creature.setHealth(creature.getHealth() + (36 + creature.getLevel() * 4));
|
||||
}
|
||||
if(creature.getHealth() < creature.getMaxHealth() && creature.getCombatFlag() == 0 && creature.getPosture() != 13 && creature.getPosture() != 14)
|
||||
creature.setHealth(creature.getHealth() + (36 + creature.getLevel() * 4));
|
||||
}, 0, 1000, TimeUnit.MILLISECONDS);
|
||||
|
||||
/*final PlayerObject ghost = (PlayerObject) creature.getSlottedObject("ghost");
|
||||
|
||||
Reference in New Issue
Block a user