Fix fuckup in the -1 tag bailout on the global tag lists.

This commit is contained in:
Nev3r 2020-04-16 14:37:01 +02:00
parent 786e448f16
commit 1d572c5b2c

View file

@ -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);