From af74a2f4918e39cd3a157350b9c8e00397c94ff8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:38:40 +1000 Subject: Rename global WorldTimestep var to more appropriate name --- source/game/StarWorldClient.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/game/StarWorldClient.cpp') diff --git a/source/game/StarWorldClient.cpp b/source/game/StarWorldClient.cpp index 34214ba..0b15afd 100644 --- a/source/game/StarWorldClient.cpp +++ b/source/game/StarWorldClient.cpp @@ -58,7 +58,7 @@ WorldClient::WorldClient(PlayerPtr mainPlayer) { return m_tileArray->tile({x, y}).collision; }); - m_modifiedTilePredictionTimeout = (int)round(m_clientConfig.getFloat("modifiedTilePredictionTimeout") / WorldTimestep); + m_modifiedTilePredictionTimeout = (int)round(m_clientConfig.getFloat("modifiedTilePredictionTimeout") / GlobalTimestep); m_latency = 0.0; @@ -756,7 +756,7 @@ void WorldClient::handleIncomingPackets(List const& packets) { } } else if (auto entityUpdateSet = as(packet)) { - float interpolationLeadTime = m_interpolationTracker.interpolationLeadSteps() * WorldTimestep; + float interpolationLeadTime = m_interpolationTracker.interpolationLeadSteps() * GlobalTimestep; m_entityMap->forAllEntities([&](EntityPtr const& entity) { EntityId entityId = entity->entityId(); if (connectionForEntity(entityId) == entityUpdateSet->forConnection) { @@ -767,7 +767,7 @@ void WorldClient::handleIncomingPackets(List const& packets) { } else if (auto entityDestroy = as(packet)) { if (auto entity = m_entityMap->entity(entityDestroy->entityId)) { - entity->readNetState(entityDestroy->finalNetState, m_interpolationTracker.interpolationLeadSteps() * WorldTimestep); + entity->readNetState(entityDestroy->finalNetState, m_interpolationTracker.interpolationLeadSteps() * GlobalTimestep); // Before destroying the entity, we should make sure that the entity is // using the absolute latest data, so we disable interpolation. @@ -874,7 +874,7 @@ void WorldClient::handleIncomingPackets(List const& packets) { tryGiveMainPlayerItem(itemDatabase->item(giveItem->item)); } else if (auto stepUpdate = as(packet)) { - m_currentServerStep = ((double)stepUpdate->remoteStep * (WorldTimestep / ServerWorldTimestep)); + m_currentServerStep = ((double)stepUpdate->remoteStep * (GlobalTimestep / ServerGlobalTimestep)); m_interpolationTracker.receiveStepUpdate(m_currentServerStep); } else if (auto environmentUpdatePacket = as(packet)) { -- cgit v1.2.3