change tickNetInterpolation calls to use dt value
This commit is contained in:
parent
e6d2f5975b
commit
caf7abebfe
@ -17,24 +17,24 @@ void NetElementGroup::clearNetElements() {
|
|||||||
|
|
||||||
void NetElementGroup::initNetVersion(NetElementVersion const* version) {
|
void NetElementGroup::initNetVersion(NetElementVersion const* version) {
|
||||||
m_version = version;
|
m_version = version;
|
||||||
for (auto p : m_elements)
|
for (auto& p : m_elements)
|
||||||
p.first->initNetVersion(m_version);
|
p.first->initNetVersion(m_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetElementGroup::netStore(DataStream& ds) const {
|
void NetElementGroup::netStore(DataStream& ds) const {
|
||||||
for (auto p : m_elements)
|
for (auto& p : m_elements)
|
||||||
p.first->netStore(ds);
|
p.first->netStore(ds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetElementGroup::netLoad(DataStream& ds) {
|
void NetElementGroup::netLoad(DataStream& ds) {
|
||||||
for (auto p : m_elements)
|
for (auto& p : m_elements)
|
||||||
p.first->netLoad(ds);
|
p.first->netLoad(ds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetElementGroup::enableNetInterpolation(float extrapolationHint) {
|
void NetElementGroup::enableNetInterpolation(float extrapolationHint) {
|
||||||
m_interpolationEnabled = true;
|
m_interpolationEnabled = true;
|
||||||
m_extrapolationHint = extrapolationHint;
|
m_extrapolationHint = extrapolationHint;
|
||||||
for (auto p : m_elements) {
|
for (auto& p : m_elements) {
|
||||||
if (p.second)
|
if (p.second)
|
||||||
p.first->enableNetInterpolation(extrapolationHint);
|
p.first->enableNetInterpolation(extrapolationHint);
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ void NetElementGroup::enableNetInterpolation(float extrapolationHint) {
|
|||||||
void NetElementGroup::disableNetInterpolation() {
|
void NetElementGroup::disableNetInterpolation() {
|
||||||
m_interpolationEnabled = false;
|
m_interpolationEnabled = false;
|
||||||
m_extrapolationHint = 0;
|
m_extrapolationHint = 0;
|
||||||
for (auto p : m_elements) {
|
for (auto& p : m_elements) {
|
||||||
if (p.second)
|
if (p.second)
|
||||||
p.first->disableNetInterpolation();
|
p.first->disableNetInterpolation();
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ void NetElementGroup::disableNetInterpolation() {
|
|||||||
|
|
||||||
void NetElementGroup::tickNetInterpolation(float dt) {
|
void NetElementGroup::tickNetInterpolation(float dt) {
|
||||||
if (m_interpolationEnabled) {
|
if (m_interpolationEnabled) {
|
||||||
for (auto p : m_elements)
|
for (auto& p : m_elements)
|
||||||
p.first->tickNetInterpolation(dt);
|
p.first->tickNetInterpolation(dt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ void NetElementGroup::readNetDelta(DataStream& ds, float interpolationTime) {
|
|||||||
|
|
||||||
void NetElementGroup::blankNetDelta(float interpolationTime) {
|
void NetElementGroup::blankNetDelta(float interpolationTime) {
|
||||||
if (m_interpolationEnabled) {
|
if (m_interpolationEnabled) {
|
||||||
for (auto p : m_elements)
|
for (auto& p : m_elements)
|
||||||
p.first->blankNetDelta(interpolationTime);
|
p.first->blankNetDelta(interpolationTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ void ItemDrop::update(float dt, uint64_t) {
|
|||||||
} else {
|
} else {
|
||||||
if (m_itemDescriptor.pullUpdated())
|
if (m_itemDescriptor.pullUpdated())
|
||||||
Root::singleton().itemDatabase()->loadItem(m_itemDescriptor.get(), m_item);
|
Root::singleton().itemDatabase()->loadItem(m_itemDescriptor.get(), m_item);
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
if (m_owningEntity.get() != NullEntityId) {
|
if (m_owningEntity.get() != NullEntityId) {
|
||||||
if (!isMaster() && m_dropAge.elapsedTime() > 1.0f)
|
if (!isMaster() && m_dropAge.elapsedTime() > 1.0f)
|
||||||
m_owningEntity.set(NullEntityId);
|
m_owningEntity.set(NullEntityId);
|
||||||
|
@ -466,7 +466,7 @@ void Monster::update(float dt, uint64_t) {
|
|||||||
m_statusController->tickMaster(dt);
|
m_statusController->tickMaster(dt);
|
||||||
updateStatus(dt);
|
updateStatus(dt);
|
||||||
} else {
|
} else {
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
|
|
||||||
m_statusController->tickSlave(dt);
|
m_statusController->tickSlave(dt);
|
||||||
updateStatus(dt);
|
updateStatus(dt);
|
||||||
|
@ -458,7 +458,7 @@ void Npc::update(float dt, uint64_t) {
|
|||||||
m_humanoid.setDance(m_dance);
|
m_humanoid.setDance(m_dance);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
m_movementController->tickSlave(dt);
|
m_movementController->tickSlave(dt);
|
||||||
m_statusController->tickSlave(dt);
|
m_statusController->tickSlave(dt);
|
||||||
|
|
||||||
|
@ -733,7 +733,7 @@ void Plant::update(float dt, uint64_t) {
|
|||||||
m_windLevel += damageEffectPercentage * 20;
|
m_windLevel += damageEffectPercentage * 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ void PlantDrop::update(float dt, uint64_t) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
|
|
||||||
if (m_spawnedDropEffects && !m_spawnedDrops.get())
|
if (m_spawnedDropEffects && !m_spawnedDrops.get())
|
||||||
m_spawnedDropEffects = false; // false positive assumption over already having done the effect
|
m_spawnedDropEffects = false; // false positive assumption over already having done the effect
|
||||||
|
@ -976,7 +976,7 @@ void Player::update(float dt, uint64_t) {
|
|||||||
m_interestingObjects = m_questManager->interestingObjects();
|
m_interestingObjects = m_questManager->interestingObjects();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
m_movementController->tickSlave(dt);
|
m_movementController->tickSlave(dt);
|
||||||
m_techController->tickSlave(dt);
|
m_techController->tickSlave(dt);
|
||||||
m_statusController->tickSlave(dt);
|
m_statusController->tickSlave(dt);
|
||||||
|
@ -336,7 +336,7 @@ void Projectile::update(float dt, uint64_t) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
m_movementController->tickSlave(dt);
|
m_movementController->tickSlave(dt);
|
||||||
m_travelLine.min() = m_travelLine.max();
|
m_travelLine.min() = m_travelLine.max();
|
||||||
m_travelLine.max() = m_movementController->position();
|
m_travelLine.max() = m_movementController->position();
|
||||||
|
@ -285,7 +285,7 @@ void Vehicle::update(float dt, uint64_t) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
|
|
||||||
m_movementController.tickSlave(dt);
|
m_movementController.tickSlave(dt);
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ void PhysicsObject::uninit() {
|
|||||||
void PhysicsObject::update(float dt, uint64_t currentStep) {
|
void PhysicsObject::update(float dt, uint64_t currentStep) {
|
||||||
Object::update(dt, currentStep);
|
Object::update(dt, currentStep);
|
||||||
if (isSlave())
|
if (isSlave())
|
||||||
m_netGroup.tickNetInterpolation(GlobalTimestep);
|
m_netGroup.tickNetInterpolation(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
RectF PhysicsObject::metaBoundBox() const {
|
RectF PhysicsObject::metaBoundBox() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user