private void SprintDisableTest(ICharacterState state, IAdaptiveContainer <IFsmInputCommand> commands) { int slowDown = NoLimit; int prevSlowDown = state.GetSteepSlowDown(); if (IsLimitRun(state.GetSteepAngle(), prevSlowDown)) { for (int i = 0; i < commands.Length; ++i) { var v = commands[i]; if (v.Type == FsmInput.Sprint || v.Type == FsmInput.Run) { v.Type = FsmInput.Walk; _logger.DebugFormat("sprint to Walk due to move in water or is steep slope!, angle:{0}", state.GetSteepAngle()); slowDown = LimitRun; } } } else if (state.IsMoveInWater() || IsLimitSprint(state.GetSteepAngle(), prevSlowDown)) { for (int i = 0; i < commands.Length; ++i) { var v = commands[i]; if (v.Type == FsmInput.Sprint) { v.Type = FsmInput.Run; _logger.DebugFormat("sprint to run due to move in water or is steep slope!, angle:{0}", state.GetSteepAngle()); slowDown = LimitSprint; } } } state.SetSteepSlowDown(slowDown); }