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/items/StarActiveItem.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/items/StarActiveItem.cpp')
-rw-r--r-- | source/game/items/StarActiveItem.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/game/items/StarActiveItem.cpp b/source/game/items/StarActiveItem.cpp index 9e7ed3f..49e82be 100644 --- a/source/game/items/StarActiveItem.cpp +++ b/source/game/items/StarActiveItem.cpp @@ -119,7 +119,7 @@ void ActiveItem::uninit() { m_activeAudio.clear(); } -void ActiveItem::update(FireMode fireMode, bool shifting, HashSet<MoveControlType> const& moves) { +void ActiveItem::update(float dt, FireMode fireMode, bool shifting, HashSet<MoveControlType> const& moves) { StringMap<bool> moveMap; for (auto m : moves) moveMap[MoveControlTypeNames.getRight(m)] = true; @@ -130,7 +130,7 @@ void ActiveItem::update(FireMode fireMode, bool shifting, HashSet<MoveControlTyp if (fireMode != FireMode::None) m_script.invoke("activate", FireModeNames.getRight(fireMode), shifting, moveMap); } - m_script.update(m_script.updateDt(), FireModeNames.getRight(fireMode), shifting, moveMap); + m_script.update(m_script.updateDt(dt), FireModeNames.getRight(fireMode), shifting, moveMap); if (instanceValue("retainScriptStorageInItem", false).toBool()) { setInstanceValue("scriptStorage", m_script.getScriptStorage()); @@ -139,10 +139,10 @@ void ActiveItem::update(FireMode fireMode, bool shifting, HashSet<MoveControlTyp bool isClient = world()->isClient(); if (isClient) { - m_itemAnimator.update(WorldTimestep, &m_itemAnimatorDynamicTarget); - m_scriptedAnimator.update(m_scriptedAnimator.updateDt()); + m_itemAnimator.update(dt, &m_itemAnimatorDynamicTarget); + m_scriptedAnimator.update(m_scriptedAnimator.updateDt(dt)); } else { - m_itemAnimator.update(WorldTimestep, nullptr); + m_itemAnimator.update(dt, nullptr); } eraseWhere(m_activeAudio, [this](pair<AudioInstancePtr const, Vec2F> const& a) { |