Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1587,16 +1587,20 @@ void ScriptEngine::loadEntityScript(const EntityItemID& entityID, const QString& · 1586 unmodified lines | |||
| 1587 | } else { | 1587 | } else { |
| 1588 | // since not reloading, assume that the exact same input would produce the exact same output again | 1588 | // since not reloading, assume that the exact same input would produce the exact same output again |
| 1589 | // note: this state gets reset with "reload all scripts," leaving/returning to a Domain, clear cache, etc. | 1589 | // note: this state gets reset with "reload all scripts," leaving/returning to a Domain, clear cache, etc. |
| 1590 | #ifdef DEBUG_ENTITY_STATES | ||
| 1590 | qCDebug(scriptengine) << QString("loadEntityScript.cancelled entity: %1 script: %2 (previous script failure)") | 1591 | qCDebug(scriptengine) << QString("loadEntityScript.cancelled entity: %1 script: %2 (previous script failure)") |
| 1591 | .arg(entityID.toString()).arg(entityScript); | 1592 | .arg(entityID.toString()).arg(entityScript); |
| 1593 | #endif | ||
| 1592 | updateEntityScriptStatus(entityID, EntityScriptStatus::ERROR_LOADING_SCRIPT, | 1594 | updateEntityScriptStatus(entityID, EntityScriptStatus::ERROR_LOADING_SCRIPT, |
| 1593 | "A previous Entity failed to load using this script URL; reload to try again."); | 1595 | "A previous Entity failed to load using this script URL; reload to try again."); |
| 1594 | return; | 1596 | return; |
| 1595 | } | 1597 | } |
| 1596 | } else { | 1598 | } else { |
| 1597 | // another entity is busy loading from this script URL so wait for them to finish | 1599 | // another entity is busy loading from this script URL so wait for them to finish |
| 1600 | #ifdef DEBUG_ENTITY_STATES | ||
| 1598 | qCDebug(scriptengine) << QString("loadEntityScript.deferring[%0] entity: %1 script: %2 (waiting on %3)") | 1601 | qCDebug(scriptengine) << QString("loadEntityScript.deferring[%0] entity: %1 script: %2 (waiting on %3)") |
| 1599 | .arg( _deferredEntityLoads.size()).arg(entityID.toString()).arg(entityScript).arg(currentEntityID.toString()); | 1602 | .arg( _deferredEntityLoads.size()).arg(entityID.toString()).arg(entityScript).arg(currentEntityID.toString()); |
| 1603 | #endif | ||
| 1600 | _deferredEntityLoads.push_back({ entityID, entityScript }); | 1604 | _deferredEntityLoads.push_back({ entityID, entityScript }); |
| 1601 | return; | 1605 | return; |
| 1602 | } | 1606 | } |
| @@ -1687,7 +1691,9 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 84 unmodified lines | |||
| 1687 | newDetails.status = status; | 1691 | newDetails.status = status; |
| 1688 | setEntityScriptDetails(entityID, newDetails); | 1692 | setEntityScriptDetails(entityID, newDetails); |
| 1689 | 1693 | ||
| 1694 | #ifdef DEBUG_ENTITY_STATES | ||
| 1690 | qCDebug(scriptengine) << "entityScriptContentAvailable -- flagging " << entityScript << " as BAD_SCRIPT_UUID_PLACEHOLDER"; | 1695 | qCDebug(scriptengine) << "entityScriptContentAvailable -- flagging " << entityScript << " as BAD_SCRIPT_UUID_PLACEHOLDER"; |
| 1696 | #endif | ||
| 1691 | // flag the original entityScript as unusuable | 1697 | // flag the original entityScript as unusuable |
| 1692 | _occupiedScriptURLs[entityScript] = BAD_SCRIPT_UUID_PLACEHOLDER; | 1698 | _occupiedScriptURLs[entityScript] = BAD_SCRIPT_UUID_PLACEHOLDER; |
| 1693 | processDeferredEntityLoads(entityScript, entityID); | 1699 | processDeferredEntityLoads(entityScript, entityID); |