From 96fa3b124ee54cd0bb99fb958984a797012f985a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 6 May 2015 23:24:27 +0200 Subject: [PATCH] - fixed: Trying to remove sector tags for line-less sectors crashed when there were no sector tags at all in a map. --- src/p_tags.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/p_tags.cpp b/src/p_tags.cpp index 851c4ee94..c08caec8f 100644 --- a/src/p_tags.cpp +++ b/src/p_tags.cpp @@ -98,13 +98,16 @@ void FTagManager::AddSectorTag(int sector, int tag) void FTagManager::RemoveSectorTags(int sect) { - int start = startForSector[sect]; - if (start >= 0) + if (startForSector.Size() > 0) { - while (allTags[start].target == sect) + int start = startForSector[sect]; + if (start >= 0) { - allTags[start].tag = allTags[start].target = -1; - start++; + while (allTags[start].target == sect) + { + allTags[start].tag = allTags[start].target = -1; + start++; + } } } }