mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 16:06:45 +02:00
Unload script when replaced with empty URL
This commit is contained in:
parent
d292451f91
commit
24f4107c92
1 changed files with 2 additions and 2 deletions
|
@ -1027,11 +1027,11 @@ void EntityTreeRenderer::checkAndCallPreload(const EntityItemID& entityID, bool
|
|||
}
|
||||
bool shouldLoad = entity->shouldPreloadScript() && _entitiesScriptEngine;
|
||||
QString scriptUrl = entity->getScript();
|
||||
if (shouldLoad && (unloadFirst || scriptUrl.isEmpty())) {
|
||||
if ((shouldLoad && unloadFirst) || scriptUrl.isEmpty()) {
|
||||
_entitiesScriptEngine->unloadEntityScript(entityID);
|
||||
entity->scriptHasUnloaded();
|
||||
}
|
||||
if (shouldLoad && !scriptUrl.isEmpty()) {
|
||||
if (shouldLoad) {
|
||||
scriptUrl = ResourceManager::normalizeURL(scriptUrl);
|
||||
_entitiesScriptEngine->loadEntityScript(entityID, scriptUrl, reload);
|
||||
entity->scriptHasPreloaded();
|
||||
|
|
Loading…
Reference in a new issue