From 1d572c5b2c1516b22cd004c5cd92e741fbe8edde Mon Sep 17 00:00:00 2001 From: Nev3r Date: Thu, 16 Apr 2020 14:37:01 +0200 Subject: [PATCH] Fix fuckup in the -1 tag bailout on the global tag lists. --- src/taglist.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/taglist.c b/src/taglist.c index fcce7adc3..5174fe2d7 100644 --- a/src/taglist.c +++ b/src/taglist.c @@ -41,12 +41,13 @@ void Taglist_AddToSectors (const size_t tag, const size_t itemid) void Taglist_AddToLines (const size_t tag, const size_t itemid) { taggroup_t* tagelems; - if (!tags_lines[tag]) - tags_lines[tag] = Z_Calloc(sizeof(taggroup_t), PU_LEVEL, NULL); if (tag == -1) return; + if (!tags_lines[tag]) + tags_lines[tag] = Z_Calloc(sizeof(taggroup_t), PU_LEVEL, NULL); + tagelems = tags_lines[tag]; tagelems->count++; tagelems->elements = Z_Realloc(tagelems->elements, tagelems->count * sizeof(size_t), PU_LEVEL, NULL); @@ -56,12 +57,13 @@ void Taglist_AddToLines (const size_t tag, const size_t itemid) void Taglist_AddToMapthings (const size_t tag, const size_t itemid) { taggroup_t* tagelems; - if (!tags_mapthings[tag]) - tags_mapthings[tag] = Z_Calloc(sizeof(taggroup_t), PU_LEVEL, NULL); if (tag == -1) return; + if (!tags_mapthings[tag]) + tags_mapthings[tag] = Z_Calloc(sizeof(taggroup_t), PU_LEVEL, NULL); + tagelems = tags_mapthings[tag]; tagelems->count++; tagelems->elements = Z_Realloc(tagelems->elements, tagelems->count * sizeof(size_t), PU_LEVEL, NULL);