Fix yield_ms().
This fixes https://code.google.com/p/singularity-viewer/issues/detail?id=714 The problem was a typo in AIStateMachine::sleep, >= should have been <= which caused a state machine that uses yield_ms() to never run anymore when next run it already should have run again. AIFilePicker is the only state machine that currently uses yield_ms and I hadn't spotted this because I don't have plugin messages on by default which made my viewer just that much faster that it the yield never expired the first run already (causing it to expire immediately). The rest of the changes in this commit are just minor improvements / conformation to the EXAMPLE_CODE in aistatemachine.cpp.
This commit is contained in:
@@ -296,7 +296,7 @@ class AIStateMachine : public LLThreadSafeRefCount
|
||||
return false;
|
||||
else if (mSleep < 0)
|
||||
++mSleep;
|
||||
else if ((U64)mSleep >= current_time)
|
||||
else if ((U64)mSleep <= current_time)
|
||||
mSleep = 0;
|
||||
return mSleep != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user