Fix initialization list order.
Also fixes a Dout line and initializes mState to 0 so that if ever set_state would be called first from a non-main thread then it will be larger (probably not needed currently).
This commit is contained in:
@@ -82,7 +82,8 @@ void AIStateMachine::setMaxCount(F32 StateMachineMaxTime)
|
||||
|
||||
void AIStateMachine::run(AIStateMachine* parent, state_type new_parent_state, bool abort_parent, bool on_abort_signal_parent)
|
||||
{
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::run(" << (void*)parent << ", " << (parent ? parent->state_str(new_parent_state) : "NA") << ", " << abort_parent << ") [" << (void*)this << "]");
|
||||
DoutEntering(dc::statemachine, "AIStateMachine::run(" << (void*)parent << ", " << (parent ? parent->state_str(new_parent_state) : "NA") <<
|
||||
", " << abort_parent << ", " << on_abort_signal_parent << ") [" << (void*)this << "]");
|
||||
// Must be the first time we're being run, or we must be called from a callback function.
|
||||
llassert(!mParent || mState == bs_callback);
|
||||
llassert(!mCallback || mState == bs_callback);
|
||||
|
||||
@@ -250,10 +250,11 @@ class AIStateMachine {
|
||||
|
||||
public:
|
||||
//! Create a non-running state machine.
|
||||
AIStateMachine(void) : mState(bs_initialize), mIdle(true), mAborted(true), mActive(as_idle), mSleep(0), mParent(NULL), mCallback(NULL)
|
||||
AIStateMachine(void) : mState(bs_initialize), mIdle(true), mAborted(true), mActive(as_idle), mSleep(0),
|
||||
#ifdef SHOW_ASSERT
|
||||
, mContThread(AIThreadID::none), mCalledThreadUnsafeIdle(false)
|
||||
mContThread(AIThreadID::none), mCalledThreadUnsafeIdle(false),
|
||||
#endif
|
||||
mParent(NULL), mCallback(NULL), mRunState(0)
|
||||
{ }
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user