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