diff --git a/Source/Entities/AEJetpack.cpp b/Source/Entities/AEJetpack.cpp index 2778752789..89568df4d8 100644 --- a/Source/Entities/AEJetpack.cpp +++ b/Source/Entities/AEJetpack.cpp @@ -195,7 +195,11 @@ void AEJetpack::Burst(Actor& parentActor, float fuelUseMultiplier) { EnableEmission(true); AlarmOnEmit(m_Team); // Jetpacks are noisy! - float fuelUsage = g_TimerMan.GetDeltaTimeMS() * static_cast(std::max(GetTotalBurstSize(), 2)) * (CanTriggerBurst() ? 1.0F : 0.5F) * fuelUseMultiplier; // burst fuel + // TODO: burst emissions shouldn't be affected by delta time, but they sort of are. + // Hack here to use constant 60Hz deltatime in milliseconds. + + float fuelUsage = (1000.0f / 60.0f) * static_cast(std::max(GetTotalBurstSize(), 2)) * (CanTriggerBurst() ? 1.0F : 0.5F) * fuelUseMultiplier; // burst fuel + fuelUsage += g_TimerMan.GetDeltaTimeMS() * fuelUseMultiplier; // emit fuel m_JetTimeLeft -= fuelUsage; } diff --git a/Source/Entities/AEmitter.cpp b/Source/Entities/AEmitter.cpp index 40bdedc416..9405978d40 100644 --- a/Source/Entities/AEmitter.cpp +++ b/Source/Entities/AEmitter.cpp @@ -276,9 +276,14 @@ float AEmitter::EstimateImpulse(bool burst) { for (Emission* emission: m_EmissionList) { // Only check emissions that push the emitter if (emission->PushesEmitter()) { - // Todo... we're not checking emission start/stop times here, so this will always calculate the impulse as if the emission was active. + // TODO: we're not checking emission start/stop times here, so this will always calculate the impulse as if the emission was active. // There's not really an easy way to do this, since the emission rate is not necessarily constant over time. - float emissions = (emission->GetRate() / 60.0f) * g_TimerMan.GetDeltaTimeSecs(); + + // TODO: burst emissions shouldn't be affected by delta time, but they sort of are. + // Hack here to use constant 60Hz deltatime in seconds. + float deltaTimeSecs = burst ? 1.0f / 60.0f : g_TimerMan.GetDeltaTimeSecs(); + + float emissions = (emission->GetRate() / 60.0f) * deltaTimeSecs; float scale = 1.0F; if (burst) { emissions *= emission->GetBurstSize(); diff --git a/Source/Entities/AHuman.cpp b/Source/Entities/AHuman.cpp index 5cf483ea88..a578038e15 100644 --- a/Source/Entities/AHuman.cpp +++ b/Source/Entities/AHuman.cpp @@ -992,7 +992,9 @@ float AHuman::EstimateJumpHeight() const { // Account for the forces upon us. if (!hasBursted && fuelTime > 0.0F) { currentYVelocity += impulseBurst; - fuelTime -= g_TimerMan.GetDeltaTimeMS() * fuelUseMultiplierBurst; + // TODO: burst emissions shouldn't be affected by delta time, but they sort of are. + // Hack here to use constant 60Hz deltatime in milliseconds. + fuelTime -= (1000.0f / 60.0f) * fuelUseMultiplierBurst; hasBursted = true; }