From 4b0bc220e4da1173f742a4973939b139bef562db Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Fri, 21 Jul 2023 00:58:49 +1000 Subject: Support for changing the game's timescale Context-specific (like per-world) timescales can also be added later --- source/game/StarDamageManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/game/StarDamageManager.cpp') 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(); if (event.timeout <= 0.0f || (entityIdTimeoutGroup && !m_world->entity(*entityIdTimeoutGroup))) eventIt.remove(); -- cgit v1.2.3