HideState now switches to patrolstate when necessary.
StateMachine now initializes the current and previous state as nullptr.
time() function call now gets nullptr instead of NULL.