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:
Aleric Inglewood
2013-02-23 21:13:14 +01:00
parent 78bb94eb42
commit 5d329d9e55
2 changed files with 5 additions and 3 deletions

View File

@@ -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);

View File

@@ -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: