Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 4 files). Show all
Unified · Split
| @@ -567,6 +567,7 @@ void EntityScriptServer::addingEntity(const EntityItemID& entityID) { · 566 unmodified lines | |||
| 567 | 567 | ||
| 568 | void EntityScriptServer::deletingEntity(const EntityItemID& entityID) { | 568 | void EntityScriptServer::deletingEntity(const EntityItemID& entityID) { |
| 569 | if (_entityViewer.getTree() && !_shuttingDown && _entitiesScriptManager) { | 569 | if (_entityViewer.getTree() && !_shuttingDown && _entitiesScriptManager) { |
| 570 | // TODO: Check if this is running on script engine thread, otherwise lambda capturing script engine pointer is needed | ||
| 570 | _entitiesScriptManager->unloadEntityScript(entityID, true); | 571 | _entitiesScriptManager->unloadEntityScript(entityID, true); |
| 571 | } | 572 | } |
| 572 | } | 573 | } |
| @@ -584,6 +585,7 @@ void EntityScriptServer::checkAndCallPreload(const EntityItemID& entityID, bool · 11 unmodified lines | |||
| 584 | EntityScriptDetails details; | 585 | EntityScriptDetails details; |
| 585 | bool isRunning = _entitiesScriptManager->getEntityScriptDetails(entityID, details); | 586 | bool isRunning = _entitiesScriptManager->getEntityScriptDetails(entityID, details); |
| 586 | if (entity && (forceRedownload || !isRunning || details.scriptText != entity->getServerScripts())) { | 587 | if (entity && (forceRedownload || !isRunning || details.scriptText != entity->getServerScripts())) { |
| 588 | // TODO: Check if this is running on script engine thread, otherwise lambda capturing script engine pointer is needed | ||
| 587 | if (isRunning) { | 589 | if (isRunning) { |
| 588 | _entitiesScriptManager->unloadEntityScript(entityID, true); | 590 | _entitiesScriptManager->unloadEntityScript(entityID, true); |
| 589 | } | 591 | } |