diff options
author | Don Kjer <don@lindenlab.com> | 2007-05-02 21:24:47 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-05-02 21:24:47 +0000 |
commit | 1c909afe3998778e4cc045c9ab733e8afbf7c25b (patch) | |
tree | 75c00a32a8e305280cbec253195d1113d628fc3e /indra/llcharacter/llstatemachine.cpp | |
parent | bc59c04653bf1404e8148a8169208b146a123b28 (diff) |
svn merge -r 60342:61148 svn+ssh://svn/svn/linden/branches/maintenance into release
Diffstat (limited to 'indra/llcharacter/llstatemachine.cpp')
-rw-r--r-- | indra/llcharacter/llstatemachine.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/indra/llcharacter/llstatemachine.cpp b/indra/llcharacter/llstatemachine.cpp index d51b2f75aa..9fd043bdbf 100644 --- a/indra/llcharacter/llstatemachine.cpp +++ b/indra/llcharacter/llstatemachine.cpp @@ -342,28 +342,28 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d { llassert(mStateDiagram); + if (NULL == mCurrentState) + { + llwarns << "mCurrentState == NULL; aborting processTransition()" << llendl; + return; + } + LLFSMState* new_state = mStateDiagram->processTransition(*mCurrentState, transition); + if (NULL == new_state) + { + llwarns << "new_state == NULL; aborting processTransition()" << llendl; + return; + } + mLastTransition = &transition; mLastState = mCurrentState; if (*mCurrentState != *new_state) { - if (mCurrentState && new_state && *mCurrentState != *new_state) - { - mCurrentState->onExit(user_data); - } - if (new_state) - { - if (!mCurrentState || *mCurrentState != *new_state) - { - mCurrentState = new_state; - if (mCurrentState) - { - mCurrentState->onEntry(user_data); - } - } - } + mCurrentState->onExit(user_data); + mCurrentState = new_state; + mCurrentState->onEntry(user_data); #if FSM_PRINT_STATE_TRANSITIONS llinfos << "Entering state " << mCurrentState->getName() << " on transition " << transition.getName() << " from state " << |