Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarWorldClient.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-21 15:48:27 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-21 15:48:27 +1000
commitacc8bc02800ce97dbc5424a3d83a1add1593349d (patch)
treee1134bc87dbc7ff3a75cbe8766f3fb45ef0ffe9d /source/game/StarWorldClient.cpp
parentd6fdd960768cbb94a67a1d3cdd34c606807ac180 (diff)
EntityUpdate server-side optimization
Cache net states of the same net version. Also moved readNetState after init in EntityCreate, should fix bugs like MovementController rotation not being read.
Diffstat (limited to 'source/game/StarWorldClient.cpp')
-rw-r--r--source/game/StarWorldClient.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp
index 0dfddf8..f8942d2 100644
--- a/source/game/StarWorldClient.cpp
+++ b/source/game/StarWorldClient.cpp
@@ -656,8 +656,8 @@ void WorldClient::handleIncomingPackets(List<PacketPtr> const& packets) {
}
auto entity = entityFactory->netLoadEntity(entityCreate->entityType, entityCreate->storeData);
- entity->readNetState(entityCreate->firstNetState);
entity->init(this, entityCreate->entityId, EntityMode::Slave);
+ entity->readNetState(entityCreate->firstNetState);
m_entityMap->addEntity(entity);
if (m_interpolationTracker.interpolationEnabled()) {