change tickNetInterpolation calls to use dt value

This commit is contained in:
Kae 2024-03-11 16:31:20 +11:00
parent e6d2f5975b
commit caf7abebfe
10 changed files with 16 additions and 16 deletions

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -733,7 +733,7 @@ void Plant::update(float dt, uint64_t) {
m_windLevel += damageEffectPercentage * 20;
}
m_netGroup.tickNetInterpolation(GlobalTimestep);
m_netGroup.tickNetInterpolation(dt);
}
}

View File

@ -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

View File

@ -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);

View File

@ -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();

View File

@ -285,7 +285,7 @@ void Vehicle::update(float dt, uint64_t) {
}
}
} else {
m_netGroup.tickNetInterpolation(GlobalTimestep);
m_netGroup.tickNetInterpolation(dt);
m_movementController.tickSlave(dt);

View File

@ -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 {