mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
fsm: FourState needs to initialize stateIndex BEFORE first debugPrint
I honestly have no idea how this even worked before.
This commit is contained in:
parent
f773bf6328
commit
6d250f2f1f
@ -90,6 +90,7 @@ class FourState:
|
|||||||
off (and so is state 2 which is oposite of 4 and therefore
|
off (and so is state 2 which is oposite of 4 and therefore
|
||||||
oposite of 'on').
|
oposite of 'on').
|
||||||
"""
|
"""
|
||||||
|
self.stateIndex = 0
|
||||||
assert self.debugPrint("FourState(names=%s)"%(names))
|
assert self.debugPrint("FourState(names=%s)"%(names))
|
||||||
self.track = None
|
self.track = None
|
||||||
self.stateTime = 0.0
|
self.stateTime = 0.0
|
||||||
@ -120,7 +121,6 @@ class FourState:
|
|||||||
self.exitState4,
|
self.exitState4,
|
||||||
[names[1]]),
|
[names[1]]),
|
||||||
}
|
}
|
||||||
self.stateIndex = 0
|
|
||||||
self.fsm = ClassicFSM.ClassicFSM('FourState',
|
self.fsm = ClassicFSM.ClassicFSM('FourState',
|
||||||
list(self.states.values()),
|
list(self.states.values()),
|
||||||
# Initial State
|
# Initial State
|
||||||
|
@ -93,11 +93,11 @@ class FourStateAI:
|
|||||||
off (and so is state 2 which is oposite of state 4 and therefore
|
off (and so is state 2 which is oposite of state 4 and therefore
|
||||||
oposite of 'on').
|
oposite of 'on').
|
||||||
"""
|
"""
|
||||||
|
self.stateIndex = 0
|
||||||
assert self.debugPrint(
|
assert self.debugPrint(
|
||||||
"FourStateAI(names=%s, durations=%s)"
|
"FourStateAI(names=%s, durations=%s)"
|
||||||
%(names, durations))
|
%(names, durations))
|
||||||
self.doLaterTask = None
|
self.doLaterTask = None
|
||||||
self.stateIndex = 0
|
|
||||||
assert len(names) == 5
|
assert len(names) == 5
|
||||||
assert len(names) == len(durations)
|
assert len(names) == len(durations)
|
||||||
self.names = names
|
self.names = names
|
||||||
|
Loading…
x
Reference in New Issue
Block a user