Don't let DEarthquake depend on r_viewpoint.
The ticFrac value should be passed as a parameter, especially since this gets called from code that sets up r_viewpoint.
This commit is contained in:
parent
01bda6348e
commit
d73d89762d
3 changed files with 10 additions and 10 deletions
|
|
@ -177,9 +177,9 @@ void DEarthquake::Tick ()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
double DEarthquake::GetModWave(double waveMultiplier) const
|
||||
double DEarthquake::GetModWave(double ticFrac, double waveMultiplier) const
|
||||
{
|
||||
double time = m_Countdown - r_viewpoint.TicFrac;
|
||||
double time = m_Countdown - ticFrac;
|
||||
return g_sin(waveMultiplier * time * (M_PI * 2 / TICRATE));
|
||||
}
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ double DEarthquake::GetFalloff(double dist) const
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
int DEarthquake::StaticGetQuakeIntensities(AActor *victim, FQuakeJiggers &jiggers)
|
||||
int DEarthquake::StaticGetQuakeIntensities(double ticFrac, AActor *victim, FQuakeJiggers &jiggers)
|
||||
{
|
||||
if (victim->player != NULL && (victim->player->cheats & CF_NOCLIP))
|
||||
{
|
||||
|
|
@ -339,12 +339,12 @@ int DEarthquake::StaticGetQuakeIntensities(AActor *victim, FQuakeJiggers &jigger
|
|||
}
|
||||
else
|
||||
{
|
||||
jiggers.RollWave = r * quake->GetModWave(quake->m_RollWave) * falloff * strength;
|
||||
jiggers.RollWave = r * quake->GetModWave(ticFrac, quake->m_RollWave) * falloff * strength;
|
||||
|
||||
|
||||
intensity.X *= quake->GetModWave(quake->m_WaveSpeed.X);
|
||||
intensity.Y *= quake->GetModWave(quake->m_WaveSpeed.Y);
|
||||
intensity.Z *= quake->GetModWave(quake->m_WaveSpeed.Z);
|
||||
intensity.X *= quake->GetModWave(ticFrac, quake->m_WaveSpeed.X);
|
||||
intensity.Y *= quake->GetModWave(ticFrac, quake->m_WaveSpeed.Y);
|
||||
intensity.Z *= quake->GetModWave(ticFrac, quake->m_WaveSpeed.Z);
|
||||
intensity *= strength * falloff;
|
||||
|
||||
// [RH] This only gives effect to the last sine quake. I would
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue