diff --git a/src/game/collision.cpp b/src/game/collision.cpp index 331f27c0f..059615252 100644 --- a/src/game/collision.cpp +++ b/src/game/collision.cpp @@ -30,9 +30,17 @@ CCollision::CCollision() m_pTune = 0; } +CCollision::~CCollision() +{ + if(m_pLayers) + m_pLayers->Dest(); + Dest(); +} + void CCollision::Init(class CLayers *pLayers) { - if(m_pLayers) m_pLayers->Dest(); + if(m_pLayers) + m_pLayers->Dest(); Dest(); m_NumSwitchers = 0; m_pLayers = pLayers; diff --git a/src/game/collision.h b/src/game/collision.h index 97c3af868..518b3a9c3 100644 --- a/src/game/collision.h +++ b/src/game/collision.h @@ -17,6 +17,7 @@ class CCollision public: CCollision(); + ~CCollision(); void Init(class CLayers *pLayers); bool CheckPoint(float x, float y) { return IsSolid(round_to_int(x), round_to_int(y)); } bool CheckPoint(vec2 Pos) { return CheckPoint(Pos.x, Pos.y); }