- Fixed: When a skybox viewpoint is destroyed it should clear all

sector references to itself.


SVN r600 (trunk)
This commit is contained in:
Christoph Oelckers 2007-12-17 22:18:52 +00:00
parent dd460fed2a
commit 4d6fc97a9a
3 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,7 @@
December 17, 2007 (Changes by Graf Zahl)
- Fixed: When a skybox viewpoint is destroyed it should clear all
sector references to itself.
December 14, 2007
- Fixed: G_QueueBody() should only change the translation to one of its
private slots if the one currently used is a player range.

View file

@ -122,6 +122,7 @@ class ASkyViewpoint : public AActor
public:
void Serialize (FArchive &arc);
void BeginPlay ();
void Destroy ();
bool bInSkybox;
bool bAlways;
ASkyViewpoint *Mate;

View file

@ -72,6 +72,22 @@ void ASkyViewpoint::Serialize (FArchive &arc)
arc << bInSkybox << bAlways << Mate << PlaneAlpha;
}
void ASkyViewpoint::Destroy ()
{
// remove all sector references to ourselves.
for (int i = 0; i <numsectors; i++)
{
if (sectors[i].FloorSkyBox == this)
{
sectors[i].FloorSkyBox = NULL;
}
if (sectors[i].CeilingSkyBox == this)
{
sectors[i].CeilingSkyBox = NULL;
}
}
}
//---------------------------------------------------------------------------
// arg0 = tid of matching SkyViewpoint