fix issue where beams were also disappearing while the game was paused

This commit is contained in:
2026-06-20 08:24:10 +02:00
parent 405206211e
commit c43225b6fa
4 changed files with 14 additions and 16 deletions

View File

@@ -141,11 +141,12 @@ private:
struct ActiveBeam
{
BeamFiredEvent event;
qint64 emittedWallMs;
QVector2D targetOffset;
};
static constexpr qint64 kBeamLifetimeMs = 300;
// Beam lifetime in game ticks so beams freeze with the simulation when
// paused or slowed, instead of fading on wall-clock time (REQ-SHP-FIRING-BEAM).
static constexpr Tick kBeamLifetimeTicks = secondsToTicks(0.3);
static constexpr float kScrollSpeedTilesPerSec = 10.0f;
Simulation* m_sim;
@@ -154,7 +155,6 @@ private:
TickDriver m_tickDriver;
QElapsedTimer m_frameTimer;
qint64 m_wallMs;
std::mt19937 m_rng;
double m_gameSpeedMultiplier;
double m_prevNonZeroSpeed;