diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index 0aa7ea629..fff9edf10 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -3677,6 +3677,7 @@ udmf 0 = "Add tag"; 1 = "Remove tag"; 2 = "Replace first tag"; + 3 = "Change trigger tag"; } } } @@ -3699,6 +3700,7 @@ udmf 0 = "Add tag"; 1 = "Remove tag"; 2 = "Replace first tag"; + 3 = "Change trigger tag"; } } } diff --git a/src/p_spec.c b/src/p_spec.c index c000960b5..78878de1d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2396,6 +2396,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) default: Tag_SectorFSet(secnum, newtag); break; + case TMT_TRIGGERTAG: + sectors[secnum].triggertag = newtag; + break; } } break; @@ -2418,6 +2421,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) default: Tag_SectorFSet(secnum, newtag); break; + case TMT_TRIGGERTAG: + sectors[secnum].triggertag = newtag; + break; } break; } diff --git a/src/p_spec.h b/src/p_spec.h index bdc912c34..33d18d63e 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -306,6 +306,7 @@ typedef enum TMT_ADD = 0, TMT_REMOVE = 1, TMT_REPLACEFIRST = 2, + TMT_TRIGGERTAG = 3, } textmaptagoptions_t; typedef enum diff --git a/src/taglist.c b/src/taglist.c index 9bc6021b0..305b05f04 100644 --- a/src/taglist.c +++ b/src/taglist.c @@ -14,6 +14,7 @@ #include "taglist.h" #include "z_zone.h" #include "r_data.h" +#include "p_spec.h" // Bit array of whether a tag exists for sectors/lines/things. bitarray_t tags_available[BIT_ARRAY_SIZE (MAXTAGS)]; @@ -454,6 +455,11 @@ 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 (!udmf && GETSECSPECIAL(sec->special, 2) >= 1 && GETSECSPECIAL(sec->special, 2) <= 7) + sec->triggertag = tag; } mtag_t Tag_NextUnused(mtag_t start)