Commit 9b3ca239 authored by gentlespoon's avatar gentlespoon Committed by Melledy
Browse files

Prepare MovementManager.updateStamina() for external calls.

parent ff52255a
...@@ -179,8 +179,6 @@ public class MovementManager { ...@@ -179,8 +179,6 @@ public class MovementManager {
return player.getProperty(PlayerProperty.PROP_MAX_STAMINA); return player.getProperty(PlayerProperty.PROP_MAX_STAMINA);
} }
// Returns new stamina // Returns new stamina
public int updateStamina(GameSession session, int amount) { public int updateStamina(GameSession session, int amount) {
int currentStamina = session.getPlayer().getProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA); int currentStamina = session.getPlayer().getProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA);
...@@ -196,6 +194,7 @@ public class MovementManager { ...@@ -196,6 +194,7 @@ public class MovementManager {
newStamina = playerMaxStamina; newStamina = playerMaxStamina;
} }
session.getPlayer().setProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA, newStamina); session.getPlayer().setProperty(PlayerProperty.PROP_CUR_PERSIST_STAMINA, newStamina);
session.send(new PacketPlayerPropNotify(player, PlayerProperty.PROP_CUR_PERSIST_STAMINA));
return newStamina; return newStamina;
} }
...@@ -309,7 +308,6 @@ public class MovementManager { ...@@ -309,7 +308,6 @@ public class MovementManager {
} }
Grasscutter.getLogger().debug(getCurrentStamina() + "/" + getMaximumStamina() + "\t" + currentState + "\t" + "isMoving: " + isPlayerMoving() + "\t(" + consumption.consumptionType + "," + consumption.amount + ")"); Grasscutter.getLogger().debug(getCurrentStamina() + "/" + getMaximumStamina() + "\t" + currentState + "\t" + "isMoving: " + isPlayerMoving() + "\t(" + consumption.consumptionType + "," + consumption.amount + ")");
updateStamina(cachedSession, consumption.amount); updateStamina(cachedSession, consumption.amount);
cachedSession.send(new PacketPlayerPropNotify(player, PlayerProperty.PROP_CUR_PERSIST_STAMINA));
} }
// tick triggered // tick triggered
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment