- fixed: Old portal data must be deleted before loading a new level.

This commit is contained in:
Christoph Oelckers 2016-02-19 20:51:47 +01:00
parent cb0e7c6ca5
commit dc37f78566
4 changed files with 16 additions and 2 deletions

View File

@ -4178,7 +4178,6 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b
// they're obviously not the same.
return 0;
}
int i, numff;
FTextureID secpic;
sector_t *resultsec;
F3DFloor *resffloor;

View File

@ -3392,12 +3392,12 @@ void P_FreeLevelData ()
FPolyObj::ClearAllSubsectorLinks(); // can't be done as part of the polyobj deletion process.
SN_StopAllSequences ();
DThinker::DestroyAllThinkers ();
P_ClearPortals();
tagManager.Clear();
level.total_monsters = level.total_items = level.total_secrets =
level.killed_monsters = level.found_items = level.found_secrets =
wminfo.maxfrags = 0;
linePortals.Clear();
FBehavior::StaticUnloadModules ();
if (vertexes != NULL)
{

View File

@ -359,6 +359,20 @@ bool P_ChangePortal(line_t *ln, int thisid, int destid)
return res;
}
//============================================================================
//
// clears all portal dat for a new level start
//
//============================================================================
void P_ClearPortals()
{
Displacements.Create(1);
linePortals.Clear();
linkedPortals.Clear();
}
//============================================================================
//
// Calculate the intersection between two lines.

View File

@ -123,6 +123,7 @@ struct FLinePortal
extern TArray<FLinePortal> linePortals;
void P_ClearPortals();
void P_SpawnLinePortal(line_t* line);
void P_FinalizePortals();
bool P_ChangePortal(line_t *ln, int thisid, int destid);