Permalink
Browse files

- register interpolators on reading serialization only

Interpolators were added twice when saving a game which led to a cycle in linked list and so to an infinite loop
  • Loading branch information...
alexey-lysiuk committed Jan 10, 2019
1 parent f44cf00 commit 2bb7d49664ab36c3d1bcad9490a36bc76d6ab1cf
Showing with 17 additions and 8 deletions.
  1. +17 −8 src/r_data/r_interpolate.cpp
@@ -535,7 +535,10 @@ void DSectorPlaneInterpolation::Serialize(FSerializer &arc)
("oldtexz", oldtexz)
("attached", attached);

sector->Level->interpolator.AddInterpolation(this);
if (arc.isReading())
{
sector->Level->interpolator.AddInterpolation(this);
}
}


@@ -656,7 +659,10 @@ void DSectorScrollInterpolation::Serialize(FSerializer &arc)
("oldx", oldx)
("oldy", oldy);

sector->Level->interpolator.AddInterpolation(this);
if (arc.isReading())
{
sector->Level->interpolator.AddInterpolation(this);
}
}


@@ -755,8 +761,10 @@ void DWallScrollInterpolation::Serialize(FSerializer &arc)
("oldx", oldx)
("oldy", oldy);

side->sector->Level->interpolator.AddInterpolation(this);

if (arc.isReading())
{
side->sector->Level->interpolator.AddInterpolation(this);
}
}

//==========================================================================
@@ -879,10 +887,11 @@ void DPolyobjInterpolation::Serialize(FSerializer &arc)
("oldverts", oldverts)
("oldcx", oldcx)
("oldcy", oldcy);
if (arc.isReading()) bakverts.Resize(oldverts.Size());

poly->GetLevel()->interpolator.AddInterpolation(this);

if (arc.isReading())
{
bakverts.Resize(oldverts.Size());
poly->GetLevel()->interpolator.AddInterpolation(this);
}
}


0 comments on commit 2bb7d49

Please sign in to comment.