Merge pull request #5291 from ZappoMan/waitToSendAllEdits

Allow Assignment Client scripts to do edits in their shutdown handler
This commit is contained in:
Philip Rosedale 2015-07-09 15:42:31 -07:00
commit cac239ad88

View file

@ -710,7 +710,13 @@ void ScriptEngine::run() {
// since we're in non-threaded mode, call process so that the packets are sent
if (!entityScriptingInterface->getEntityPacketSender()->isThreaded()) {
entityScriptingInterface->getEntityPacketSender()->process();
// wait here till the edit packet sender is completely done sending
while (entityScriptingInterface->getEntityPacketSender()->hasPacketsToSend()) {
entityScriptingInterface->getEntityPacketSender()->process();
QCoreApplication::processEvents();
}
} else {
// FIXME - do we need to have a similar "wait here" loop for non-threaded packet senders?
}
}