From 35a5c82c42834cd5fc86fc9ccea007ba44f3cd70 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Fri, 27 May 2022 13:36:55 -0500 Subject: [PATCH 1/3] Update triggertag on sector tag fset Fixes STJr/SRB2#865 --- src/taglist.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/taglist.c b/src/taglist.c index 9bc6021b0..e933b71fd 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 "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) From 37da148996f5c32966f47d2b46bc7eb9935ddb0b Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 29 May 2022 11:56:30 +0200 Subject: [PATCH 2/3] Update triggertag on Tag_SectorFSet if in binary map and the sector has a trigger special --- src/taglist.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/taglist.c b/src/taglist.c index e933b71fd..305b05f04 100644 --- a/src/taglist.c +++ b/src/taglist.c @@ -14,7 +14,7 @@ #include "taglist.h" #include "z_zone.h" #include "r_data.h" -#include "r_defs.h" +#include "p_spec.h" // Bit array of whether a tag exists for sectors/lines/things. bitarray_t tags_available[BIT_ARRAY_SIZE (MAXTAGS)]; @@ -458,10 +458,8 @@ void Tag_SectorFSet (const size_t id, const mtag_t 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) - { + if (!udmf && GETSECSPECIAL(sec->special, 2) >= 1 && GETSECSPECIAL(sec->special, 2) <= 7) sec->triggertag = tag; - } } mtag_t Tag_NextUnused(mtag_t start) From af7c0f4d6c3dae2fdc463c162431b82d5030f2e7 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 29 May 2022 12:24:14 +0200 Subject: [PATCH 3/3] Allow linedef types 409/410 to change the trigger tag --- extras/conf/udb/Includes/SRB222_linedefs.cfg | 2 ++ src/p_spec.c | 6 ++++++ src/p_spec.h | 1 + 3 files changed, 9 insertions(+) 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 69e1e3925..cd36053c9 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