Merge pull request #991 from Akz-/emi-stopchore-fix

EMI: Ignore fade times longer than 0.6 seconds in StopChore. Fixes #988
This commit is contained in:
Joel Teichroeb 2014-08-03 07:41:45 -07:00
commit 3168f06f43

View File

@ -345,6 +345,13 @@ void Lua_V2::StopChore() {
fadeTime = lua_getnumber(fadeTimeObj);
}
// There are a few cases in the scripts where StopChore is called with an excessively
// large fadeTime value. The original engine ignores fade times greater or equal
// to 0.6 seconds, so we replicate that behavior here.
if (fadeTime >= 0.6f) {
fadeTime = 0.0f;
}
Chore *c = EMIChore::getPool().getObject(chore);
if (c) {
c->stop((int)(fadeTime * 1000));