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/StarDamageManager.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/StarDamageManager.cpp')
-rw-r--r-- | source/game/StarDamageManager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/game/StarDamageManager.cpp b/source/game/StarDamageManager.cpp index eaaa82a..8c95a4f 100644 --- a/source/game/StarDamageManager.cpp +++ b/source/game/StarDamageManager.cpp @@ -58,7 +58,7 @@ DataStream& operator>>(DataStream& ds, RemoteDamageNotification& damageNotificat DamageManager::DamageManager(World* world, ConnectionId connectionId) : m_world(world), m_connectionId(connectionId) {} -void DamageManager::update() { +void DamageManager::update(float dt) { float const DefaultDamageTimeout = 1.0f; auto damageIt = makeSMutableMapIterator(m_recentEntityDamages); @@ -67,7 +67,7 @@ void DamageManager::update() { auto eventIt = makeSMutableIterator(events); while (eventIt.hasNext()) { auto& event = eventIt.next(); - event.timeout -= WorldTimestep; + event.timeout -= dt; auto entityIdTimeoutGroup = event.timeoutGroup.maybe<EntityId>(); if (event.timeout <= 0.0f || (entityIdTimeoutGroup && !m_world->entity(*entityIdTimeoutGroup))) eventIt.remove(); |