diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 7061af788..49d8db9f1 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -830,6 +830,11 @@ bool sector_t::HasTag(int checktag) const return tag == checktag; } +bool sector_t::HasTags() const +{ + return tag != 0; +} + void sector_t::SetMainTag(int tagnum) { tag = tagnum; @@ -864,11 +869,6 @@ void line_t::SetMainId(int newid) id = newid; } -int line_t::GetMainId() const -{ - return id; -} - void line_t::ClearIds() { id = -1; diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 09cee8441..657281a11 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -778,6 +778,7 @@ public: bool strifetrans = false; bool strifetrans2 = false; FString arg0str, arg1str; + int lineid; // forZDoomTranslated namespace memset(ld, 0, sizeof(*ld)); ld->Alpha = FRACUNIT; @@ -814,7 +815,8 @@ public: continue; case NAME_Id: - ld->SetMainId(CheckInt(key)); + lineid = CheckInt(key); + ld->SetMainId(lineid); continue; case NAME_Sidefront: @@ -1067,7 +1069,7 @@ public: maplinedef_t mld; memset(&mld, 0, sizeof(mld)); mld.special = ld->special; - mld.tag = ld->GetMainId(); + mld.tag = lineid; P_TranslateLineDef(ld, &mld, false); ld->flags = saved | (ld->flags&(ML_MONSTERSCANACTIVATE|ML_REPEAT_SPECIAL|ML_FIRSTSIDEONLY)); } diff --git a/src/p_xlat.cpp b/src/p_xlat.cpp index 4b1373817..76d0cb811 100644 --- a/src/p_xlat.cpp +++ b/src/p_xlat.cpp @@ -307,7 +307,7 @@ void P_TranslateTeleportThings () while ( (dest = iterator.Next()) ) { - if (dest->Sector->GetMainTag() == 0) + if (!dest->Sector->HasTags()) { dest->tid = 1; dest->AddToHash (); diff --git a/src/r_defs.h b/src/r_defs.h index 1865777d3..3cf25573c 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -634,6 +634,7 @@ struct sector_t } bool HasTag(int checktag) const; + bool HasTags() const; void SetMainTag(int tagnum); int GetMainTag() const; void ClearTags(); @@ -908,7 +909,6 @@ struct line_t void SetMainId(int newid); - int GetMainId() const; void ClearIds(); bool HasId(int id) const; static void HashIds();