Hi,
I would switch to enums. So the enum would contain something like “sprint”, “jog”, “walk”, … so all your states, lets call this enum “EMovementType”. Then I would create one function to switch the state. So this function takes a variable of “EMovementType” as input. For the allowed changes I would create a new structure that contains an array of “EMovementType”, lets call it “FMovementTypes”. Then create a variable (map) that maps from “EMovementType” to “FMovementTypes” (input movement type to allowed movement types from there).
So via the current movement type you access the map and get an array of allowed movement types from there. Then you only continue if this array contains the new movement type. If so then do the change, if not do nothing.