- fixed all the missed level references in the decal thinkers.

This commit is contained in:
Christoph Oelckers 2019-01-28 02:07:46 +01:00
parent 472a1118dd
commit aee8851643

View file

@ -1184,11 +1184,11 @@ void DDecalFader::Tick ()
}
else
{
if (level.maptime < TimeToStartDecay || bglobal.freeze)
if (Level->maptime < TimeToStartDecay || bglobal.freeze)
{
return;
}
else if (level.maptime >= TimeToEndDecay)
else if (Level->maptime >= TimeToEndDecay)
{
TheDecal->Destroy (); // remove the decal
Destroy (); // remove myself
@ -1199,7 +1199,7 @@ void DDecalFader::Tick ()
StartTrans = TheDecal->Alpha;
}
int distanceToEnd = TimeToEndDecay - level.maptime;
int distanceToEnd = TimeToEndDecay - Level->maptime;
int fadeDistance = TimeToEndDecay - TimeToStartDecay;
TheDecal->Alpha = StartTrans * distanceToEnd / fadeDistance;
}
@ -1271,11 +1271,11 @@ void DDecalStretcher::Tick ()
Destroy ();
return;
}
if (level.maptime < TimeToStart || bglobal.freeze)
if (Level->maptime < TimeToStart || bglobal.freeze)
{
return;
}
if (level.maptime >= TimeToStop)
if (Level->maptime >= TimeToStop)
{
if (bStretchX)
{
@ -1295,7 +1295,7 @@ void DDecalStretcher::Tick ()
StartY = TheDecal->ScaleY;
}
int distance = level.maptime - TimeToStart;
int distance = Level->maptime - TimeToStart;
int maxDistance = TimeToStop - TimeToStart;
if (bStretchX)
{
@ -1339,7 +1339,7 @@ void DDecalSlider::Tick ()
Destroy ();
return;
}
if (level.maptime < TimeToStart || bglobal.freeze)
if (Level->maptime < TimeToStart || bglobal.freeze)
{
return;
}
@ -1349,7 +1349,7 @@ void DDecalSlider::Tick ()
/*StartX = TheDecal->LeftDistance;*/
StartY = TheDecal->Z;
}
if (level.maptime >= TimeToStop)
if (Level->maptime >= TimeToStop)
{
/*TheDecal->LeftDistance = StartX + DistX;*/
TheDecal->Z = StartY + DistY;
@ -1357,7 +1357,7 @@ void DDecalSlider::Tick ()
return;
}
int distance = level.maptime - TimeToStart;
int distance = Level->maptime - TimeToStart;
int maxDistance = TimeToStop - TimeToStart;
/*TheDecal->LeftDistance = StartX + DistX * distance / maxDistance);*/
TheDecal->Z = StartY + DistY * distance / maxDistance;
@ -1407,11 +1407,11 @@ void DDecalColorer::Tick ()
}
else
{
if (level.maptime < TimeToStartDecay || bglobal.freeze)
if (Level->maptime < TimeToStartDecay || bglobal.freeze)
{
return;
}
else if (level.maptime >= TimeToEndDecay)
else if (Level->maptime >= TimeToEndDecay)
{
TheDecal->SetShade (GoalColor);
Destroy (); // remove myself
@ -1425,12 +1425,12 @@ void DDecalColorer::Tick ()
return;
}
}
if (level.maptime & 0)
if (Level->maptime & 0)
{ // Changing the shade can be expensive, so don't do it too often.
return;
}
int distance = level.maptime - TimeToStartDecay;
int distance = Level->maptime - TimeToStartDecay;
int maxDistance = TimeToEndDecay - TimeToStartDecay;
int r = StartColor.r + Scale (GoalColor.r - StartColor.r, distance, maxDistance);
int g = StartColor.g + Scale (GoalColor.g - StartColor.g, distance, maxDistance);