- fixed: DInterpolation was unlinking itself from the wrong interpolator

The global one was just a leftover, the real one is on the current level.
This commit is contained in:
Christoph Oelckers 2019-01-31 03:25:26 +01:00
parent 65f3fec283
commit 0a781b9bbb
2 changed files with 8 additions and 2 deletions

View file

@ -373,7 +373,7 @@ int DInterpolation::DelRef(bool force)
void DInterpolation::OnDestroy() void DInterpolation::OnDestroy()
{ {
interpolator.RemoveInterpolation(this); Level->interpolator.RemoveInterpolation(this);
refcount = 0; refcount = 0;
Super::OnDestroy(); Super::OnDestroy();
} }
@ -388,6 +388,7 @@ void DInterpolation::Serialize(FSerializer &arc)
{ {
Super::Serialize(arc); Super::Serialize(arc);
arc("refcount", refcount); arc("refcount", refcount);
arc("level", Level);
} }
//========================================================================== //==========================================================================
@ -403,6 +404,7 @@ void DInterpolation::Serialize(FSerializer &arc)
//========================================================================== //==========================================================================
DSectorPlaneInterpolation::DSectorPlaneInterpolation(sector_t *_sector, bool _plane, bool attach) DSectorPlaneInterpolation::DSectorPlaneInterpolation(sector_t *_sector, bool _plane, bool attach)
: DInterpolation(sector->Level)
{ {
sector = _sector; sector = _sector;
ceiling = _plane; ceiling = _plane;
@ -568,6 +570,7 @@ size_t DSectorPlaneInterpolation::PropagateMark()
//========================================================================== //==========================================================================
DSectorScrollInterpolation::DSectorScrollInterpolation(sector_t *_sector, bool _plane) DSectorScrollInterpolation::DSectorScrollInterpolation(sector_t *_sector, bool _plane)
: DInterpolation(sector->Level)
{ {
sector = _sector; sector = _sector;
ceiling = _plane; ceiling = _plane;
@ -673,6 +676,7 @@ void DSectorScrollInterpolation::Serialize(FSerializer &arc)
//========================================================================== //==========================================================================
DWallScrollInterpolation::DWallScrollInterpolation(side_t *_side, int _part) DWallScrollInterpolation::DWallScrollInterpolation(side_t *_side, int _part)
: DInterpolation(side->GetLevel())
{ {
side = _side; side = _side;
part = _part; part = _part;
@ -770,6 +774,7 @@ void DWallScrollInterpolation::Serialize(FSerializer &arc)
//========================================================================== //==========================================================================
DPolyobjInterpolation::DPolyobjInterpolation(FPolyObj *po) DPolyobjInterpolation::DPolyobjInterpolation(FPolyObj *po)
: DInterpolation(po->Level)
{ {
poly = po; poly = po;
oldverts.Resize(po->Vertices.Size() << 1); oldverts.Resize(po->Vertices.Size() << 1);

View file

@ -19,9 +19,10 @@ class DInterpolation : public DObject
TObjPtr<DInterpolation*> Prev; TObjPtr<DInterpolation*> Prev;
protected: protected:
FLevelLocals *Level;
int refcount; int refcount;
DInterpolation(); DInterpolation(FLevelLocals *l) : Level(l) {}
public: public:
int AddRef(); int AddRef();