mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 10:51:47 +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;
|
||||
}
|
||||
|
||||
// Update previous motion state
|
||||
this.previousState = currentState;
|
||||
|
||||
// Update the current state.
|
||||
this.currentState = motionState;
|
||||
// logger.trace(currentState + "\t" + (notifyEntityId == currentAvatarEntityId ? "character" : "vehicle"));
|
||||
@ -417,6 +420,11 @@ public class StaminaManager extends BasePlayerManager {
|
||||
// Internal handler
|
||||
|
||||
private void handleImmediateStamina(GameSession session, @NotNull MotionState motionState) {
|
||||
// Don't double dip on sustained stamina start costs
|
||||
if (previousState == currentState) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (motionState) {
|
||||
case MOTION_STATE_CLIMB ->
|
||||
updateStaminaRelative(session, new Consumption(ConsumptionType.CLIMB_START), true);
|
||||
|
Loading…
Reference in New Issue
Block a user