More reliable stamina calculation

by separately handling immediate one-time cost and cost over time.
This commit is contained in:
gentlespoon
2022-05-07 05:00:50 -07:00
committed by Melledy
parent 43c27c4679
commit 8e99cb4f35
5 changed files with 268 additions and 246 deletions

View File

@@ -1152,7 +1152,7 @@ public class Player {
public void onLogout() {
// stop stamina calculation
getMovementManager().resetTimer();
getMovementManager().stopSustainedStaminaHandler();
// force to leave the dungeon
if (getScene().getSceneType() == SceneType.SCENE_DUNGEON) {

View File

@@ -557,7 +557,7 @@ public class TeamManager {
// return;
// }
// }
player.getMovementManager().resetTimer(); // prevent drowning immediately after respawn
player.getMovementManager().stopSustainedStaminaHandler(); // prevent drowning immediately after respawn
// Revive all team members
for (EntityAvatar entity : getActiveTeam()) {