- flag combo stuff.

This commit is contained in:
Christoph Oelckers 2021-12-18 15:16:31 +01:00
parent b263c3ac6b
commit adbf5177a7
7 changed files with 18 additions and 17 deletions

View file

@ -501,7 +501,7 @@ int cansee(int x1, int y1, int z1, sectortype* sect1, int x2, int y2, int z2, se
} }
if (!wal->twoSided() || wal->cstat&32) if (!wal->twoSided() || wal->cstat & CSTAT_WALL_1WAY)
return 0; return 0;
t = DivScale(t,bot, 24); t = DivScale(t,bot, 24);

View file

@ -301,8 +301,9 @@ void MarkSectorSeen(sectortype* sec)
for (auto& wal : wallsofsector(sec)) for (auto& wal : wallsofsector(sec))
{ {
if (!wal.twoSided()) continue; if (!wal.twoSided()) continue;
if (wal.cstat & 0x0071) continue; const auto bits = (CSTAT_WALL_BLOCK | CSTAT_WALL_MASKED | CSTAT_WALL_1WAY | CSTAT_WALL_BLOCK_HITSCAN);
if (wal.nextWall()->cstat & 0x0071) continue; if (wal.cstat & bits) continue;
if (wal.nextWall()->cstat & bits) continue;
auto osec = wal.nextSector(); auto osec = wal.nextSector();
if (osec->lotag == 32767) continue; if (osec->lotag == 32767) continue;
if (osec->ceilingz >= osec->floorz) continue; if (osec->ceilingz >= osec->floorz) continue;
@ -390,7 +391,7 @@ bool ShowRedLine(int j, int i)
{ {
if (sector[i].floorz != sector[i].ceilingz) if (sector[i].floorz != sector[i].ceilingz)
if (wal->nextSector()->floorz != wal->nextSector()->ceilingz) if (wal->nextSector()->floorz != wal->nextSector()->ceilingz)
if (((wal->cstat | wal->nextWall()->cstat) & (16 + 32)) == 0) if (((wal->cstat | wal->nextWall()->cstat) & (CSTAT_WALL_MASKED | CSTAT_WALL_1WAY)) == 0)
if (sector[i].floorz == wal->nextSector()->floorz) if (sector[i].floorz == wal->nextSector()->floorz)
return false; return false;
if (sector[i].floorpicnum != wal->nextSector()->floorpicnum) if (sector[i].floorpicnum != wal->nextSector()->floorpicnum)
@ -429,7 +430,7 @@ void drawredlines(int cposx, int cposy, int czoom, int cang)
auto osec = wal.nextSector(); auto osec = wal.nextSector();
if (osec->ceilingz == z1 && osec->floorz == z2) if (osec->ceilingz == z1 && osec->floorz == z2)
if (((wal.cstat | wal.nextWall()->cstat) & (16 + 32)) == 0) continue; if (((wal.cstat | wal.nextWall()->cstat) & (CSTAT_WALL_MASKED | CSTAT_WALL_1WAY)) == 0) continue;
if (ShowRedLine(wallnum(&wal), i)) if (ShowRedLine(wallnum(&wal), i))
{ {

View file

@ -4141,13 +4141,13 @@ void handle_se19(DDukeActor *actor, int BIGFORCE)
{ {
if (wal.overpicnum == BIGFORCE) if (wal.overpicnum == BIGFORCE)
{ {
wal.cstat &= (128 + 32 + 8 + 4 + 2); wal.cstat &= (CSTAT_WALL_TRANSLUCENT | CSTAT_WALL_1WAY | CSTAT_WALL_XFLIP | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_BOTTOM_SWAP);
wal.overpicnum = 0; wal.overpicnum = 0;
auto nextwal = wal.nextWall(); auto nextwal = wal.nextWall();
if (nextwal != nullptr) if (nextwal != nullptr)
{ {
nextwal->overpicnum = 0; nextwal->overpicnum = 0;
nextwal->cstat &= (128 + 32 + 8 + 4 + 2); nextwal->cstat &= (CSTAT_WALL_TRANSLUCENT | CSTAT_WALL_1WAY | CSTAT_WALL_XFLIP | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_BOTTOM_SWAP);
} }
} }
} }
@ -4707,12 +4707,12 @@ void handle_se128(DDukeActor *actor)
//if (wal->cstat | 32) // this has always been bugged, the condition can never be false. //if (wal->cstat | 32) // this has always been bugged, the condition can never be false.
{ {
wal->cstat &= (255 - 32); wal->cstat &= ~CSTAT_WALL_1WAY;
wal->cstat |= 16; wal->cstat |= CSTAT_WALL_MASKED;
if (wal->twoSided()) if (wal->twoSided())
{ {
wal->nextWall()->cstat &= (255 - 32); wal->nextWall()->cstat &= ~CSTAT_WALL_1WAY;
wal->nextWall()->cstat |= 16; wal->nextWall()->cstat |= CSTAT_WALL_MASKED;
} }
} }
// else return; // else return;
@ -4725,9 +4725,9 @@ void handle_se128(DDukeActor *actor)
if (t[0] < t[1]) t[0]++; if (t[0] < t[1]) t[0]++;
else else
{ {
wal->cstat &= (128 + 32 + 8 + 4 + 2); wal->cstat &= (CSTAT_WALL_TRANSLUCENT | CSTAT_WALL_1WAY | CSTAT_WALL_XFLIP | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_BOTTOM_SWAP);
if (nextwal) if (nextwal)
nextwal->cstat &= (128 + 32 + 8 + 4 + 2); nextwal->cstat &= (CSTAT_WALL_TRANSLUCENT | CSTAT_WALL_1WAY | CSTAT_WALL_XFLIP | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_BOTTOM_SWAP);
deletesprite(actor); deletesprite(actor);
} }
} }

View file

@ -423,7 +423,7 @@ void prelevel_d(int g, TArray<DDukeActor*>& actors)
case W_FORCEFIELD + 2: case W_FORCEFIELD + 2:
if (wal.shade > 31) if (wal.shade > 31)
wal.cstat = 0; wal.cstat = 0;
else wal.cstat |= 85 + 256; else wal.cstat |= CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN | CSTAT_WALL_YFLIP;
if (wal.lotag && wal.twoSided()) if (wal.lotag && wal.twoSided())
wal.nextWall()->lotag = wal.lotag; wal.nextWall()->lotag = wal.lotag;

View file

@ -1207,7 +1207,7 @@ void operateforcefields_common(DDukeActor *effector, int low, const std::initial
wal->lotag = 0; wal->lotag = 0;
} }
else else
wal->cstat = 85; wal->cstat = (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN);
} }
} }
} }

View file

@ -918,7 +918,7 @@ void checkplayerhurt_d(struct player_struct* p, const Collision& coll)
auto wal = coll.hitWall; auto wal = coll.hitWall;
if (p->hurt_delay > 0) p->hurt_delay--; if (p->hurt_delay > 0) p->hurt_delay--;
else if (wal->cstat & 85) switch (wal->overpicnum) else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) switch (wal->overpicnum)
{ {
case W_FORCEFIELD: case W_FORCEFIELD:
case W_FORCEFIELD + 1: case W_FORCEFIELD + 1:

View file

@ -1421,7 +1421,7 @@ void checkplayerhurt_r(struct player_struct* p, const Collision &coll)
auto wal = coll.hitWall; auto wal = coll.hitWall;
if (p->hurt_delay > 0) p->hurt_delay--; if (p->hurt_delay > 0) p->hurt_delay--;
else if (wal->cstat & 85) switch (wal->overpicnum) else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) switch (wal->overpicnum)
{ {
case BIGFORCE: case BIGFORCE:
p->hurt_delay = 26; p->hurt_delay = 26;