From dc37f78566afc6e1edd4566b05355ed58b99a4a2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 19 Feb 2016 20:51:47 +0100 Subject: [PATCH] - fixed: Old portal data must be deleted before loading a new level. --- src/p_acs.cpp | 1 - src/p_setup.cpp | 2 +- src/portal.cpp | 14 ++++++++++++++ src/portal.h | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) 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);