diff --git a/src/p_acs.cpp b/src/p_acs.cpp index c6b96252d4..54101ae13b 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -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; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 55dbdfcac3..b1cb43c25f 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -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) { diff --git a/src/portal.cpp b/src/portal.cpp index 62c44ce2f0..ef22eade34 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -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. diff --git a/src/portal.h b/src/portal.h index 33fb866921..5ea0293ac4 100644 --- a/src/portal.h +++ b/src/portal.h @@ -123,6 +123,7 @@ struct FLinePortal extern TArray linePortals; +void P_ClearPortals(); void P_SpawnLinePortal(line_t* line); void P_FinalizePortals(); bool P_ChangePortal(line_t *ln, int thisid, int destid);