diff --git a/direct/src/fsm/FourState.py b/direct/src/fsm/FourState.py index 6f42046cef..e29e494ff9 100755 --- a/direct/src/fsm/FourState.py +++ b/direct/src/fsm/FourState.py @@ -91,6 +91,7 @@ class FourState: off (and so is state 2 which is oposite of 4 and therefore oposite of 'on'). """ + self.stateIndex = 0 assert self.debugPrint("FourState(names=%s)"%(names)) self.track = None self.stateTime = 0.0 @@ -121,7 +122,6 @@ class FourState: self.exitState4, [names[1]]), } - self.stateIndex = 0 self.fsm = ClassicFSM.ClassicFSM('FourState', self.states.values(), # Initial State diff --git a/direct/src/fsm/FourStateAI.py b/direct/src/fsm/FourStateAI.py index d81d2bcf47..1c491aaecf 100755 --- a/direct/src/fsm/FourStateAI.py +++ b/direct/src/fsm/FourStateAI.py @@ -93,11 +93,11 @@ class FourStateAI: off (and so is state 2 which is oposite of state 4 and therefore oposite of 'on'). """ + self.stateIndex = 0 assert self.debugPrint( "FourStateAI(names=%s, durations=%s)" %(names, durations)) self.doLaterTask = None - self.stateIndex = 0 assert len(names) == 5 assert len(names) == len(durations) self.names = names