From 0a781b9bbb1bfdb4e59f1e1e8b56d6f57f8edcfd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 31 Jan 2019 03:25:26 +0100 Subject: [PATCH] - fixed: DInterpolation was unlinking itself from the wrong interpolator The global one was just a leftover, the real one is on the current level. --- src/r_data/r_interpolate.cpp | 7 ++++++- src/r_data/r_interpolate.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/r_data/r_interpolate.cpp b/src/r_data/r_interpolate.cpp index b4ab89b12..5edf79df4 100644 --- a/src/r_data/r_interpolate.cpp +++ b/src/r_data/r_interpolate.cpp @@ -373,7 +373,7 @@ int DInterpolation::DelRef(bool force) void DInterpolation::OnDestroy() { - interpolator.RemoveInterpolation(this); + Level->interpolator.RemoveInterpolation(this); refcount = 0; Super::OnDestroy(); } @@ -388,6 +388,7 @@ void DInterpolation::Serialize(FSerializer &arc) { Super::Serialize(arc); arc("refcount", refcount); + arc("level", Level); } //========================================================================== @@ -403,6 +404,7 @@ void DInterpolation::Serialize(FSerializer &arc) //========================================================================== DSectorPlaneInterpolation::DSectorPlaneInterpolation(sector_t *_sector, bool _plane, bool attach) +: DInterpolation(sector->Level) { sector = _sector; ceiling = _plane; @@ -568,6 +570,7 @@ size_t DSectorPlaneInterpolation::PropagateMark() //========================================================================== DSectorScrollInterpolation::DSectorScrollInterpolation(sector_t *_sector, bool _plane) +: DInterpolation(sector->Level) { sector = _sector; ceiling = _plane; @@ -673,6 +676,7 @@ void DSectorScrollInterpolation::Serialize(FSerializer &arc) //========================================================================== DWallScrollInterpolation::DWallScrollInterpolation(side_t *_side, int _part) +: DInterpolation(side->GetLevel()) { side = _side; part = _part; @@ -770,6 +774,7 @@ void DWallScrollInterpolation::Serialize(FSerializer &arc) //========================================================================== DPolyobjInterpolation::DPolyobjInterpolation(FPolyObj *po) +: DInterpolation(po->Level) { poly = po; oldverts.Resize(po->Vertices.Size() << 1); diff --git a/src/r_data/r_interpolate.h b/src/r_data/r_interpolate.h index 0696bf85f..0854fca8c 100644 --- a/src/r_data/r_interpolate.h +++ b/src/r_data/r_interpolate.h @@ -19,9 +19,10 @@ class DInterpolation : public DObject TObjPtr Prev; protected: + FLevelLocals *Level; int refcount; - DInterpolation(); + DInterpolation(FLevelLocals *l) : Level(l) {} public: int AddRef();