Update StarWorldServer.cpp

This commit is contained in:
Kae 2024-03-18 23:25:44 +11:00
parent 5a48b0383a
commit 5f01d2d4d7

View File

@ -247,7 +247,12 @@ bool WorldServer::addClient(ConnectionId clientId, SpawnTarget const& spawnTarge
clientInfo->local = isLocal; clientInfo->local = isLocal;
auto worldStartPacket = make_shared<WorldStartPacket>(); auto worldStartPacket = make_shared<WorldStartPacket>();
worldStartPacket->templateData = m_worldTemplate->store(); auto& templateData = worldStartPacket->templateData = m_worldTemplate->store();
// this makes it possible to use custom InstanceWorlds without clients having the mod that adds their dungeon:
if (templateData.optQueryString("worldParameters.primaryDungeon")
&& Root::singletonPtr()->configuration()->getPath("compatibility.customDungeonWorld").optBool().value(false))
worldStartPacket->templateData = worldStartPacket->templateData.setPath("worldParameters.primaryDungeon", "testarena");
tie(worldStartPacket->skyData, clientInfo->skyNetVersion) = m_sky->writeUpdate(); tie(worldStartPacket->skyData, clientInfo->skyNetVersion) = m_sky->writeUpdate();
tie(worldStartPacket->weatherData, clientInfo->weatherNetVersion) = m_weather.writeUpdate(); tie(worldStartPacket->weatherData, clientInfo->weatherNetVersion) = m_weather.writeUpdate();
worldStartPacket->playerStart = playerStart; worldStartPacket->playerStart = playerStart;