diff --git a/src/p_map.cpp b/src/p_map.cpp index 5dd0967b9..f409dafa4 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -630,7 +630,7 @@ int P_GetFriction(const AActor *mo, int *frictionfactor) } } - if (!(sec->special & FRICTION_MASK) && + if (!(sec->Flags & SECF_FRICTION) && Terrains[TerrainTypes[sec->GetTexture(sector_t::floor)]].Friction == 0) { continue; diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index fa1f395cf..16109891b 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -413,8 +413,12 @@ void P_SerializeWorld (FArchive &arc) if (sec->special & SECRET_MASK) { sec->Flags |= SECF_SECRET; - sec->special &= ~SECRET_MASK; } + if (sec->special & FRICTION_MASK) + { + sec->Flags |= SECF_FRICTION; + } + sec->special &= ~(SECRET_MASK|FRICTION_MASK); } arc << sec->interpolations[0] << sec->interpolations[1] diff --git a/src/p_spec.cpp b/src/p_spec.cpp index d94d91ac5..a5bdfffd4 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -1191,9 +1191,13 @@ void P_SpawnSpecials (void) if (sector->special & SECRET_MASK) { sector->Flags |= SECF_SECRET | SECF_WASSECRET; - sector->special &= ~SECRET_MASK; level.total_secrets++; } + if (sector->special & FRICTION_MASK) + { + sector->Flags |= SECF_FRICTION; + } + sector->special &= ~(SECRET_MASK|FRICTION_MASK); switch (sector->special & 0xff) { @@ -1262,7 +1266,7 @@ void P_SpawnSpecials (void) sector->friction = FRICTION_LOW; sector->movefactor = 0x269; sector->special &= 0xff00; - sector->special |= FRICTION_MASK; + sector->Flags |= SECF_FRICTION; break; // [RH] Hexen-like phased lighting @@ -2060,11 +2064,11 @@ void P_SetSectorFriction (int tag, int amount, bool alterFlag) // can be enabled and disabled at will. if (friction == ORIG_FRICTION) { - sectors[s].special &= ~FRICTION_MASK; + sectors[s].Flags &= ~SECF_FRICTION; } else { - sectors[s].special |= FRICTION_MASK; + sectors[s].Flags |= SECF_FRICTION; } } } diff --git a/src/r_defs.h b/src/r_defs.h index 0c873beeb..014fa1b32 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -355,6 +355,7 @@ enum SECF_NOFALLINGDAMAGE= 2, // No falling damage in this sector SECF_FLOORDROP = 4, // all actors standing on this floor will remain on it when it lowers very fast. SECF_NORESPAWN = 8, // players can not respawn in this sector + SECF_FRICTION = 16, // sector has friction enabled SECF_WASSECRET = 1 << 30, // a secret that was discovered