- moved friction flag from special to Flags as well.

This commit is contained in:
Christoph Oelckers 2016-01-06 02:01:59 +01:00
parent 6a63effa1f
commit 3ffcec3eb3
4 changed files with 15 additions and 6 deletions

View file

@ -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) Terrains[TerrainTypes[sec->GetTexture(sector_t::floor)]].Friction == 0)
{ {
continue; continue;

View file

@ -413,8 +413,12 @@ void P_SerializeWorld (FArchive &arc)
if (sec->special & SECRET_MASK) if (sec->special & SECRET_MASK)
{ {
sec->Flags |= SECF_SECRET; 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] arc << sec->interpolations[0]
<< sec->interpolations[1] << sec->interpolations[1]

View file

@ -1191,9 +1191,13 @@ void P_SpawnSpecials (void)
if (sector->special & SECRET_MASK) if (sector->special & SECRET_MASK)
{ {
sector->Flags |= SECF_SECRET | SECF_WASSECRET; sector->Flags |= SECF_SECRET | SECF_WASSECRET;
sector->special &= ~SECRET_MASK;
level.total_secrets++; level.total_secrets++;
} }
if (sector->special & FRICTION_MASK)
{
sector->Flags |= SECF_FRICTION;
}
sector->special &= ~(SECRET_MASK|FRICTION_MASK);
switch (sector->special & 0xff) switch (sector->special & 0xff)
{ {
@ -1262,7 +1266,7 @@ void P_SpawnSpecials (void)
sector->friction = FRICTION_LOW; sector->friction = FRICTION_LOW;
sector->movefactor = 0x269; sector->movefactor = 0x269;
sector->special &= 0xff00; sector->special &= 0xff00;
sector->special |= FRICTION_MASK; sector->Flags |= SECF_FRICTION;
break; break;
// [RH] Hexen-like phased lighting // [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. // can be enabled and disabled at will.
if (friction == ORIG_FRICTION) if (friction == ORIG_FRICTION)
{ {
sectors[s].special &= ~FRICTION_MASK; sectors[s].Flags &= ~SECF_FRICTION;
} }
else else
{ {
sectors[s].special |= FRICTION_MASK; sectors[s].Flags |= SECF_FRICTION;
} }
} }
} }

View file

@ -355,6 +355,7 @@ enum
SECF_NOFALLINGDAMAGE= 2, // No falling damage in this sector 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_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_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 SECF_WASSECRET = 1 << 30, // a secret that was discovered