From 9dbc4daacc59c1fe506d803d1d8653a395c60822 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:24:13 +1000 Subject: [PATCH] Update StarWorldServer.cpp --- source/game/StarWorldServer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/game/StarWorldServer.cpp b/source/game/StarWorldServer.cpp index 3c053bb..e1e447d 100644 --- a/source/game/StarWorldServer.cpp +++ b/source/game/StarWorldServer.cpp @@ -381,8 +381,9 @@ void WorldServer::handleIncomingPackets(ConnectionId clientId, List c clientInfo->outgoingPackets.append(make_shared(item)); } else if (auto sepacket = as(packet)) { - auto entity = entityFactory->netLoadEntity(sepacket->entityType, std::move(sepacket->storeData)); - entity->readNetState(std::move(sepacket->firstNetState), 0.0f, clientInfo->clientState.netCompatibilityRules()); + auto netRules = clientInfo->clientState.netCompatibilityRules(); + auto entity = entityFactory->netLoadEntity(sepacket->entityType, std::move(sepacket->storeData), netRules); + entity->readNetState(std::move(sepacket->firstNetState), 0.0f, netRules); addEntity(std::move(entity)); } else if (auto rdpacket = as(packet)) { @@ -433,9 +434,9 @@ void WorldServer::handleIncomingPackets(ConnectionId clientId, List c Logger::error("WorldServer received duplicate entity create packet from client, deleting old entity {}", entityCreate->entityId); removeEntity(entityCreate->entityId, false); } - - auto entity = entityFactory->netLoadEntity(entityCreate->entityType, entityCreate->storeData); - entity->readNetState(entityCreate->firstNetState, 0.0f, clientInfo->clientState.netCompatibilityRules()); + auto netRules = clientInfo->clientState.netCompatibilityRules(); + auto entity = entityFactory->netLoadEntity(entityCreate->entityType, entityCreate->storeData, netRules); + entity->readNetState(entityCreate->firstNetState, 0.0f, netRules); entity->init(this, entityCreate->entityId, EntityMode::Slave); m_entityMap->addEntity(entity);