From dc265ff9a16f50d5be552a8038a6520a7c54a705 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 29 May 2013 02:37:48 +0200 Subject: [PATCH] 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. --- indra/aistatemachine/aistatemachine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index 4b7470e26..6903589f2 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -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: