Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 1 file). Show all
Unified · Split
| @@ -109,9 +109,15 @@ void EntityScriptServer::handleReloadEntityServerScriptPacket(QSharedPointer<Rec · 108 unmodified lines | ||
| 109 | 109 | if (senderNode->getCanRez() || senderNode->getCanRezTmp()) { |
| 110 | 110 | auto entityID = QUuid::fromRfc4122(message->read(NUM_BYTES_RFC4122_UUID)); |
| 111 | 111 | |
| 112 | − if (_entityViewer.getTree() && !_shuttingDown) { | |
| 112 | + if (!_entityViewer.getTree() || _shuttingDown) { return; } | |
| 113 | + | |
| 114 | + EntityItemPointer entity = _entityViewer.getTree()->findEntityByEntityItemID(entityID); | |
| 115 | + | |
| 116 | + if (entity) { | |
| 113 | 117 | qCDebug(entity_script_server) << "Reloading: " << entityID; |
| 114 | − checkAndCallPreload(entityID, true); | |
| 118 | + | |
| 119 | + auto script = entity->getServerScripts(); | |
| 120 | + checkAndCallPreload(entityID, script, script); | |
| 115 | 121 | } |
| 116 | 122 | } |
| 117 | 123 | } |