diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-21 00:58:49 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-21 00:58:49 +1000 |
commit | 4b0bc220e4da1173f742a4973939b139bef562db (patch) | |
tree | 0ff66d5957575fa814fc10b8cd93e3dd378f45dc /source/game/StarVehicle.cpp | |
parent | 607be749451aa40e3619e7ceab0927d1fcec8233 (diff) |
Support for changing the game's timescale
Context-specific (like per-world) timescales can also be added later
Diffstat (limited to 'source/game/StarVehicle.cpp')
-rw-r--r-- | source/game/StarVehicle.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/game/StarVehicle.cpp b/source/game/StarVehicle.cpp index 5747507..89820b2 100644 --- a/source/game/StarVehicle.cpp +++ b/source/game/StarVehicle.cpp @@ -258,19 +258,19 @@ void Vehicle::disableInterpolation() { m_netGroup.disableNetInterpolation(); } -void Vehicle::update(uint64_t) { +void Vehicle::update(float dt, uint64_t) { setTeam(m_damageTeam.get()); if (world()->isClient()) { - m_networkedAnimator.update(WorldTimestep, &m_networkedAnimatorDynamicTarget); + m_networkedAnimator.update(dt, &m_networkedAnimatorDynamicTarget); m_networkedAnimatorDynamicTarget.updatePosition(position()); } else { - m_networkedAnimator.update(WorldTimestep, nullptr); + m_networkedAnimator.update(dt, nullptr); } if (isMaster()) { - m_movementController.tickMaster(); - m_scriptComponent.update(m_scriptComponent.updateDt()); + m_movementController.tickMaster(dt); + m_scriptComponent.update(m_scriptComponent.updateDt(dt)); eraseWhere(m_aliveMasterConnections, [](auto& p) { return p.second.tick(WorldTimestep); @@ -287,7 +287,7 @@ void Vehicle::update(uint64_t) { } else { m_netGroup.tickNetInterpolation(WorldTimestep); - m_movementController.tickSlave(); + m_movementController.tickSlave(dt); bool heartbeat = m_slaveHeartbeatTimer.wrapTick(); |