Update triggertag on sector tag fset

Fixes STJr/SRB2#865
This commit is contained in:
Eidolon 2022-05-27 13:36:55 -05:00
parent 0953acca15
commit 35a5c82c42

View file

@ -14,6 +14,7 @@
#include "taglist.h"
#include "z_zone.h"
#include "r_data.h"
#include "r_defs.h"
// Bit array of whether a tag exists for sectors/lines/things.
bitarray_t tags_available[BIT_ARRAY_SIZE (MAXTAGS)];
@ -454,6 +455,13 @@ void Tag_SectorFSet (const size_t id, const mtag_t tag)
Taggroup_Remove(tags_sectors, curtag, id);
Taggroup_Add(tags_sectors, tag, id);
Tag_FSet(&sec->tags, tag);
// Sectors with linedef trigger effects need to have their trigger tag updated too
// This is a bit of a hack...
if (sec->flags & MSF_TRIGGERLINE_PLANE || sec->flags & MSF_TRIGGERLINE_MOBJ)
{
sec->triggertag = tag;
}
}
mtag_t Tag_NextUnused(mtag_t start)