We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94fbc9d commit e0631bdCopy full SHA for e0631bd
magicbot/state_machine.py
@@ -516,12 +516,19 @@ def execute(self):
516
# determine if the time has passed to execute the next state
517
# -> intentionally comes first,
518
if state is not None and state.expires < tm:
519
+
520
+ previous_state = state
521
522
if state.next_state is None:
523
state = None
524
else:
525
self.next_state(state.next_state)
526
new_state_start = state.expires
527
state = self.__state
528
529
+ # Reset the expired time to prevent the state from expiring
530
+ # immediately if it's ran a second time
531
+ previous_state.expires = 0xffffffff
532
533
# deactivate the current state unless engage was called or
534
# must_finish was set
0 commit comments