Attempt to fix issue 848

https://code.google.com/p/singularity-viewer/issues/detail?id=848

If advance_state is called, then the state is NOT changed (only
sub_state_w->advance_state is set), but sub_state_w->skip_idle is set to
true in order to ignore the next call to idle (if the state machine is
already in the middle of executing a state). Therefore, this assert
would trigger. The solution is to not trigger when skip_idle is set.
This commit is contained in:
Aleric Inglewood
2013-05-29 02:37:48 +02:00
parent 48677d348f
commit dc265ff9a1

View File

@@ -615,7 +615,7 @@ void AIStateMachine::multiplex(event_type event)
// If the state is bs_multiplex we only need to run again when need_run was set again in the meantime or when this state machine isn't idle.
need_new_run = sub_state_r->need_run || !sub_state_r->idle;
// If this fails then the run state didn't change and neither idle() nor yield() was called.
llassert_always(!(need_new_run && !mYieldEngine && sub_state_r->run_state == run_state));
llassert_always(!(need_new_run && !sub_state_r->skip_idle && !mYieldEngine && sub_state_r->run_state == run_state));
}
break;
case bs_abort: