From caf7abebfe784a94fbc0e6b51e49cfeab91bf96a Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:31:20 +1100 Subject: [PATCH] change tickNetInterpolation calls to use dt value --- source/core/StarNetElementGroup.cpp | 14 +++++++------- source/game/StarItemDrop.cpp | 2 +- source/game/StarMonster.cpp | 2 +- source/game/StarNpc.cpp | 2 +- source/game/StarPlant.cpp | 2 +- source/game/StarPlantDrop.cpp | 2 +- source/game/StarPlayer.cpp | 2 +- source/game/StarProjectile.cpp | 2 +- source/game/StarVehicle.cpp | 2 +- source/game/objects/StarPhysicsObject.cpp | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/core/StarNetElementGroup.cpp b/source/core/StarNetElementGroup.cpp index d8ff6c4..249c978 100644 --- a/source/core/StarNetElementGroup.cpp +++ b/source/core/StarNetElementGroup.cpp @@ -17,24 +17,24 @@ void NetElementGroup::clearNetElements() { void NetElementGroup::initNetVersion(NetElementVersion const* version) { m_version = version; - for (auto p : m_elements) + for (auto& p : m_elements) p.first->initNetVersion(m_version); } void NetElementGroup::netStore(DataStream& ds) const { - for (auto p : m_elements) + for (auto& p : m_elements) p.first->netStore(ds); } void NetElementGroup::netLoad(DataStream& ds) { - for (auto p : m_elements) + for (auto& p : m_elements) p.first->netLoad(ds); } void NetElementGroup::enableNetInterpolation(float extrapolationHint) { m_interpolationEnabled = true; m_extrapolationHint = extrapolationHint; - for (auto p : m_elements) { + for (auto& p : m_elements) { if (p.second) p.first->enableNetInterpolation(extrapolationHint); } @@ -43,7 +43,7 @@ void NetElementGroup::enableNetInterpolation(float extrapolationHint) { void NetElementGroup::disableNetInterpolation() { m_interpolationEnabled = false; m_extrapolationHint = 0; - for (auto p : m_elements) { + for (auto& p : m_elements) { if (p.second) p.first->disableNetInterpolation(); } @@ -51,7 +51,7 @@ void NetElementGroup::disableNetInterpolation() { void NetElementGroup::tickNetInterpolation(float dt) { if (m_interpolationEnabled) { - for (auto p : m_elements) + for (auto& p : m_elements) p.first->tickNetInterpolation(dt); } } @@ -100,7 +100,7 @@ void NetElementGroup::readNetDelta(DataStream& ds, float interpolationTime) { void NetElementGroup::blankNetDelta(float interpolationTime) { if (m_interpolationEnabled) { - for (auto p : m_elements) + for (auto& p : m_elements) p.first->blankNetDelta(interpolationTime); } } diff --git a/source/game/StarItemDrop.cpp b/source/game/StarItemDrop.cpp index e7eec81..1df91f9 100644 --- a/source/game/StarItemDrop.cpp +++ b/source/game/StarItemDrop.cpp @@ -241,7 +241,7 @@ void ItemDrop::update(float dt, uint64_t) { } else { if (m_itemDescriptor.pullUpdated()) Root::singleton().itemDatabase()->loadItem(m_itemDescriptor.get(), m_item); - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); if (m_owningEntity.get() != NullEntityId) { if (!isMaster() && m_dropAge.elapsedTime() > 1.0f) m_owningEntity.set(NullEntityId); diff --git a/source/game/StarMonster.cpp b/source/game/StarMonster.cpp index 075235f..05eaeb3 100644 --- a/source/game/StarMonster.cpp +++ b/source/game/StarMonster.cpp @@ -466,7 +466,7 @@ void Monster::update(float dt, uint64_t) { m_statusController->tickMaster(dt); updateStatus(dt); } else { - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); m_statusController->tickSlave(dt); updateStatus(dt); diff --git a/source/game/StarNpc.cpp b/source/game/StarNpc.cpp index 3f15217..476dfb4 100644 --- a/source/game/StarNpc.cpp +++ b/source/game/StarNpc.cpp @@ -458,7 +458,7 @@ void Npc::update(float dt, uint64_t) { m_humanoid.setDance(m_dance); } else { - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); m_movementController->tickSlave(dt); m_statusController->tickSlave(dt); diff --git a/source/game/StarPlant.cpp b/source/game/StarPlant.cpp index 6f1dece..7b4e426 100644 --- a/source/game/StarPlant.cpp +++ b/source/game/StarPlant.cpp @@ -733,7 +733,7 @@ void Plant::update(float dt, uint64_t) { m_windLevel += damageEffectPercentage * 20; } - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); } } diff --git a/source/game/StarPlantDrop.cpp b/source/game/StarPlantDrop.cpp index b739856..ccb57d8 100644 --- a/source/game/StarPlantDrop.cpp +++ b/source/game/StarPlantDrop.cpp @@ -236,7 +236,7 @@ void PlantDrop::update(float dt, uint64_t) { } } } else { - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); if (m_spawnedDropEffects && !m_spawnedDrops.get()) m_spawnedDropEffects = false; // false positive assumption over already having done the effect diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp index 9790225..8ce809f 100644 --- a/source/game/StarPlayer.cpp +++ b/source/game/StarPlayer.cpp @@ -976,7 +976,7 @@ void Player::update(float dt, uint64_t) { m_interestingObjects = m_questManager->interestingObjects(); } else { - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); m_movementController->tickSlave(dt); m_techController->tickSlave(dt); m_statusController->tickSlave(dt); diff --git a/source/game/StarProjectile.cpp b/source/game/StarProjectile.cpp index 57d8ca8..116fd08 100644 --- a/source/game/StarProjectile.cpp +++ b/source/game/StarProjectile.cpp @@ -336,7 +336,7 @@ void Projectile::update(float dt, uint64_t) { } } } else { - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); m_movementController->tickSlave(dt); m_travelLine.min() = m_travelLine.max(); m_travelLine.max() = m_movementController->position(); diff --git a/source/game/StarVehicle.cpp b/source/game/StarVehicle.cpp index a253de1..0aec750 100644 --- a/source/game/StarVehicle.cpp +++ b/source/game/StarVehicle.cpp @@ -285,7 +285,7 @@ void Vehicle::update(float dt, uint64_t) { } } } else { - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); m_movementController.tickSlave(dt); diff --git a/source/game/objects/StarPhysicsObject.cpp b/source/game/objects/StarPhysicsObject.cpp index 9da604d..bc9da82 100644 --- a/source/game/objects/StarPhysicsObject.cpp +++ b/source/game/objects/StarPhysicsObject.cpp @@ -79,7 +79,7 @@ void PhysicsObject::uninit() { void PhysicsObject::update(float dt, uint64_t currentStep) { Object::update(dt, currentStep); if (isSlave()) - m_netGroup.tickNetInterpolation(GlobalTimestep); + m_netGroup.tickNetInterpolation(dt); } RectF PhysicsObject::metaBoundBox() const {