Quakes must use their own independent falloffs.This caused discrepencies and sudden drop-outs in stacked quakes otherwise.

This commit is contained in:
Major Cooke 2016-09-13 23:06:57 -05:00
parent fd53aefbf2
commit 3b2359959e
2 changed files with 4 additions and 7 deletions

View file

@ -291,10 +291,9 @@ int DEarthquake::StaticGetQuakeIntensities(AActor *victim, FQuakeJiggers &jigger
if (!(quake->m_Flags & QF_WAVE)) if (!(quake->m_Flags & QF_WAVE))
{ {
jiggers.Falloff = MAX(falloff, jiggers.Falloff); jiggers.RollIntensity = MAX(r, jiggers.RollIntensity) * falloff;
jiggers.RollIntensity = MAX(r, jiggers.RollIntensity) * jiggers.Falloff;
intensity *= jiggers.Falloff; intensity *= falloff;
if (quake->m_Flags & QF_RELATIVE) if (quake->m_Flags & QF_RELATIVE)
{ {
jiggers.RelIntensity.X = MAX(intensity.X, jiggers.RelIntensity.X); jiggers.RelIntensity.X = MAX(intensity.X, jiggers.RelIntensity.X);
@ -310,14 +309,13 @@ int DEarthquake::StaticGetQuakeIntensities(AActor *victim, FQuakeJiggers &jigger
} }
else else
{ {
jiggers.Falloff = MAX(falloff, jiggers.Falloff); jiggers.RollWave = r * quake->GetModWave(quake->m_RollWave) * falloff * strength;
jiggers.RollWave = r * quake->GetModWave(quake->m_RollWave) * jiggers.Falloff * strength;
intensity.X *= quake->GetModWave(quake->m_WaveSpeed.X); intensity.X *= quake->GetModWave(quake->m_WaveSpeed.X);
intensity.Y *= quake->GetModWave(quake->m_WaveSpeed.Y); intensity.Y *= quake->GetModWave(quake->m_WaveSpeed.Y);
intensity.Z *= quake->GetModWave(quake->m_WaveSpeed.Z); intensity.Z *= quake->GetModWave(quake->m_WaveSpeed.Z);
intensity *= strength * jiggers.Falloff; intensity *= strength * falloff;
// [RH] This only gives effect to the last sine quake. I would // [RH] This only gives effect to the last sine quake. I would
// prefer if some way was found to make multiples coexist // prefer if some way was found to make multiples coexist

View file

@ -153,7 +153,6 @@ struct FQuakeJiggers
DVector3 RelIntensity; DVector3 RelIntensity;
DVector3 Offset; DVector3 Offset;
DVector3 RelOffset; DVector3 RelOffset;
double Falloff;
double RollIntensity, RollWave; double RollIntensity, RollWave;
}; };