// Checks if an EntityState blocks sprinting private bool ShouldSprintBeDisabledOnThisBody(RoR2.CharacterBody targetBody) { EntityStateMachine[] stateMachines; stateMachines = targetBody.GetComponents<EntityStateMachine>(); bool isSprintBlocked = false; foreach (EntityStateMachine machine in stateMachines) { var currentState = machine.state; if (currentState == null) { return false; } #if DEBUGGY if (!knownEntityStates.Contains(currentState.ToString())) { knownEntityStates.Add(currentState.ToString()); Debug.LogError("List of Known EntityStates;"); foreach (var item in knownEntityStates) { Debug.Log(item); } } #endif if (stateSprintDisableList.Contains(currentState.ToString())) { isSprintBlocked = true; } } return isSprintBlocked; }