From 4328119e1c1f8578a92977a943a793b2ac9032e0 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Fri, 23 Jun 2023 20:27:51 +1000 Subject: [PATCH] Proper fix for non-master player rotation resetting on load --- source/game/StarPlayer.cpp | 4 ++-- source/game/StarWorldClient.cpp | 2 +- source/game/StarWorldServer.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp index 8d0ece5..0f7484a 100644 --- a/source/game/StarPlayer.cpp +++ b/source/game/StarPlayer.cpp @@ -284,16 +284,16 @@ EntityType Player::entityType() const { void Player::init(World* world, EntityId entityId, EntityMode mode) { Entity::init(world, entityId, mode); - auto speciesDefinition = Root::singleton().speciesDatabase()->species(m_identity.species); m_tools->init(this); m_movementController->init(world); m_movementController->setIgnorePhysicsEntities({entityId}); - m_movementController->setRotation(0); m_statusController->init(this, m_movementController.get()); m_techController->init(this, m_movementController.get(), m_statusController.get()); if (mode == EntityMode::Master) { + auto speciesDefinition = Root::singleton().speciesDatabase()->species(m_identity.species); + m_movementController->setRotation(0); m_statusController->setStatusProperty("ouchNoise", speciesDefinition->ouchNoise(m_identity.gender)); m_emoteState = HumanoidEmote::Idle; m_questManager->init(world); diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp index f8942d2..0dfddf8 100644 --- a/source/game/StarWorldClient.cpp +++ b/source/game/StarWorldClient.cpp @@ -656,8 +656,8 @@ void WorldClient::handleIncomingPackets(List const& packets) { } auto entity = entityFactory->netLoadEntity(entityCreate->entityType, entityCreate->storeData); - entity->init(this, entityCreate->entityId, EntityMode::Slave); entity->readNetState(entityCreate->firstNetState); + entity->init(this, entityCreate->entityId, EntityMode::Slave); m_entityMap->addEntity(entity); if (m_interpolationTracker.interpolationEnabled()) { diff --git a/source/game/StarWorldServer.cpp b/source/game/StarWorldServer.cpp index 417c718..a9b154e 100644 --- a/source/game/StarWorldServer.cpp +++ b/source/game/StarWorldServer.cpp @@ -392,8 +392,8 @@ void WorldServer::handleIncomingPackets(ConnectionId clientId, List c } auto entity = entityFactory->netLoadEntity(entityCreate->entityType, entityCreate->storeData); - entity->init(this, entityCreate->entityId, EntityMode::Slave); entity->readNetState(entityCreate->firstNetState); + entity->init(this, entityCreate->entityId, EntityMode::Slave); m_entityMap->addEntity(entity); if (clientInfo->interpolationTracker.interpolationEnabled())