History

missed part of EntityScriptServer oops

Ada committed 6 months ago

Commit 81eb8911 parent 1b12e111 file · +8 −2Browse files

Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 1 file). Show all

Unified · Split

assignment-client/src/scripts/EntityScriptServer.cpp+8−2
@@ -109,9 +109,15 @@ void EntityScriptServer::handleReloadEntityServerScriptPacket(QSharedPointer<Rec · 108 unmodified lines
109109 if (senderNode->getCanRez() || senderNode->getCanRezTmp()) {
110110 auto entityID = QUuid::fromRfc4122(message->read(NUM_BYTES_RFC4122_UUID));
111111
112− if (_entityViewer.getTree() && !_shuttingDown) {
112+ if (!_entityViewer.getTree() || _shuttingDown) { return; }
113+
114+ EntityItemPointer entity = _entityViewer.getTree()->findEntityByEntityItemID(entityID);
115+
116+ if (entity) {
113117 qCDebug(entity_script_server) << "Reloading: " << entityID;
114− checkAndCallPreload(entityID, true);
118+
119+ auto script = entity->getServerScripts();
120+ checkAndCallPreload(entityID, script, script);
115121 }
116122 }
117123 }