Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Source/Entities/AEJetpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>(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<float>(std::max(GetTotalBurstSize(), 2)) * (CanTriggerBurst() ? 1.0F : 0.5F) * fuelUseMultiplier; // burst fuel

fuelUsage += g_TimerMan.GetDeltaTimeMS() * fuelUseMultiplier; // emit fuel
m_JetTimeLeft -= fuelUsage;
}
Expand Down
9 changes: 7 additions & 2 deletions Source/Entities/AEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion Source/Entities/AHuman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down