mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 13:01:03 +00:00
Fix swim stamina cost (#2287)
This commit is contained in:
parent
8291e366b9
commit
58d2650505
@ -389,6 +389,9 @@ public class StaminaManager extends BasePlayerManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update previous motion state
|
||||||
|
this.previousState = currentState;
|
||||||
|
|
||||||
// Update the current state.
|
// Update the current state.
|
||||||
this.currentState = motionState;
|
this.currentState = motionState;
|
||||||
// logger.trace(currentState + "\t" + (notifyEntityId == currentAvatarEntityId ? "character" : "vehicle"));
|
// logger.trace(currentState + "\t" + (notifyEntityId == currentAvatarEntityId ? "character" : "vehicle"));
|
||||||
@ -417,6 +420,11 @@ public class StaminaManager extends BasePlayerManager {
|
|||||||
// Internal handler
|
// Internal handler
|
||||||
|
|
||||||
private void handleImmediateStamina(GameSession session, @NotNull MotionState motionState) {
|
private void handleImmediateStamina(GameSession session, @NotNull MotionState motionState) {
|
||||||
|
// Don't double dip on sustained stamina start costs
|
||||||
|
if (previousState == currentState) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (motionState) {
|
switch (motionState) {
|
||||||
case MOTION_STATE_CLIMB ->
|
case MOTION_STATE_CLIMB ->
|
||||||
updateStaminaRelative(session, new Consumption(ConsumptionType.CLIMB_START), true);
|
updateStaminaRelative(session, new Consumption(ConsumptionType.CLIMB_START), true);
|
||||||
|
Loading…
Reference in New Issue
Block a user