diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/script_v3.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp index 288b6720f9..3db0d4c23c 100644 --- a/engines/kyra/script_v3.cpp +++ b/engines/kyra/script_v3.cpp @@ -384,13 +384,24 @@ int KyraEngine_v3::o3_setMalcolmsMood(ScriptState *script) { int KyraEngine_v3::o3_delay(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); - const uint32 delayTime = stackPos(0) * _tickLength; - const int delayFunc = stackPos(1); + if (stackPos(1)) { + uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength; + while (_system->getMillis() < maxWaitTime) { + int inputFlag = checkInput(0); + removeInputTop(); - if (delayFunc) - warning("STUB o3_delay func 1"); + if (inputFlag == 198 || inputFlag == 199) + return 1; - delay(delayTime, true); + if (_chatText) + updateWithText(); + else + update(); + _system->delayMillis(10); + } + } else { + delay(stackPos(0) * _tickLength, true); + } return 0; } |