Fix script errors not being reported

Script.update event needs to be emitted after reporting any script errors.
This commit is contained in:
David Rowe 2014-07-08 16:33:31 -07:00
parent e579be82a2
commit bc785115a9

View file

@ -515,8 +515,6 @@ void ScriptEngine::run() {
qint64 now = usecTimestampNow();
float deltaTime = (float) (now - lastUpdate) / (float) USECS_PER_SECOND;
emit update(deltaTime);
lastUpdate = now;
if (_engine.hasUncaughtException()) {
int line = _engine.uncaughtExceptionLineNumber();
@ -524,6 +522,9 @@ void ScriptEngine::run() {
emit errorMessage("Uncaught exception at (" + _fileNameString + ") line" + QString::number(line) + ":" + _engine.uncaughtException().toString());
_engine.clearExceptions();
}
emit update(deltaTime);
lastUpdate = now;
}
emit scriptEnding();