diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 0fc13b054..c1c522a2d 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -63,6 +63,10 @@ enum ESectorBits CSTAT_SECTOR_TRANS_INVERT = 256, CSTAT_SECTOR_METHOD = 384, CSTAT_SECTOR_FAF_BLOCK_HITSCAN = 32768, // SW only + + CSTAT_SECTOR_EXHUMED_BIT1 = 1 << 14, + CSTAT_SECTOR_EXHUMED_BIT2 = 1 << 15, + }; // Extended sector bit flags. diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 8ba7b4e71..ab7d922ef 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1340,7 +1340,7 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1) auto* const pXSprite = pPlayer->pXSprite; int const florhit = pPlayer->actor->hit.florhit.type; bool const va = pXSprite->height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0; - pPlayer->horizon.calcviewpitch(pSprite->pos.vec2, buildang(pSprite->ang), va, pSprite->sector()->floorstat & 2, pSprite->sector(), scaleAdjust); + pPlayer->horizon.calcviewpitch(pSprite->pos.vec2, buildang(pSprite->ang), va, pSprite->sector()->floorstat & CSTAT_SECTOR_SLOPE, pSprite->sector(), scaleAdjust); } void ProcessInput(PLAYER *pPlayer) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 11dbb5f87..f523ff6bc 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -2316,7 +2316,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f deletesprite(actor); return false; } - if ((s->sector()->floorstat & 2)) + if ((s->sector()->floorstat & CSTAT_SECTOR_SLOPE)) { deletesprite(actor); return false; @@ -2359,7 +2359,7 @@ bool bloodpool(DDukeActor* actor, bool puke, int TIRE) if (t[0] == 0) { t[0] = 1; - if (sectp->floorstat & 2) + if (sectp->floorstat & CSTAT_SECTOR_SLOPE) { deletesprite(actor); return false; @@ -2737,7 +2737,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE) t[2] += (l * q); } - if (l && (sect->floorstat & 64)) + if (l && (sect->floorstat & CSTAT_SECTOR_ALIGN)) { int p; for (p = connecthead; p >= 0; p = connectpoint2[p]) @@ -3794,7 +3794,7 @@ void handle_se13(DDukeActor* actor) //Change the shades t[3]++; - sc->ceilingstat ^= 1; + sc->ceilingstat ^= CSTAT_SECTOR_SKY; if (s->ang == 512) { @@ -4259,7 +4259,7 @@ void handle_se20(DDukeActor* actor) a2->s->x += x; a2->s->y += l; SetActor(a2, a2->s->pos); - if (a2->sector()->floorstat & 2) + if (a2->sector()->floorstat & CSTAT_SECTOR_SLOPE) if (a2->s->statnum == 2) makeitfall(a2); } @@ -4515,7 +4515,7 @@ void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2, SetActor(a2, s2->pos); - if (s2->sector()->floorstat & 2) + if (s2->sector()->floorstat & CSTAT_SECTOR_SLOPE) if (s2->statnum == 2) makeitfall(a2); } @@ -5236,7 +5236,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO else c = gs.gravity; } - if (actor->cgg <= 0 || (s->sector()->floorstat & 2)) + if (actor->cgg <= 0 || (s->sector()->floorstat & CSTAT_SECTOR_SLOPE)) { getglobalz(actor); actor->cgg = 6; diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 253cc2f28..f2709b931 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -487,7 +487,7 @@ void footprints(int snum) auto s = actor->s; if (p->footprintcount > 0 && p->on_ground) - if ((p->cursector->floorstat & 2) != 2) + if ((p->cursector->floorstat & CSTAT_SECTOR_SLOPE) != 2) { int j = -1; DukeSectIterator it(s->sector()); diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index dd7b7424c..7950c71ac 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -734,12 +734,12 @@ void spawneffector(DDukeActor* actor, TArray* actors) if (sectp->ceilingstat & CSTAT_SECTOR_SKY) { - sectp->ceilingstat ^= 1; + sectp->ceilingstat ^= CSTAT_SECTOR_SKY; t[3] = 1; if (!ceiling && sp->ang == 512) { - sectp->ceilingstat ^= 1; + sectp->ceilingstat ^= CSTAT_SECTOR_SKY; t[3] = 0; } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index d32cf043f..2b2f83175 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -2338,7 +2338,7 @@ void AddMovingSector(sectortype* pSector, int edx, int ebx, int ecx) pMoveSect->nChannel = -1; } - pSector->floorstat |= 0x40; + pSector->floorstat |= CSTAT_SECTOR_ALIGN; } void DoMovingSects() @@ -2493,8 +2493,8 @@ void PostProcess() if (pSector->Flag & kSectUnderwater) { - pSector->ceilingstat |= 0x40; - pSector->floorstat &= 0xBFFF; + pSector->ceilingstat |= CSTAT_SECTOR_ALIGN; + pSector->floorstat &= ~(CSTAT_SECTOR_EXHUMED_BIT1 | CSTAT_SECTOR_EXHUMED_BIT2); for (unsigned j = 0; j < sMoveSect.Size(); j++) { diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 95a47fadc..9a343c185 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -291,7 +291,7 @@ void AISpider::Tick(RunListEvent* ev) if (nMov.exbits & kHitAux1 && sp->zvel < 0 && hiHit.type != kHitSprite - && !((sp->sector()->ceilingstat) & 1)) + && !((sp->sector()->ceilingstat) & CSTAT_SECTOR_SKY)) { sp->cstat |= 8; sp->z = GetActorHeight(spp) + sp->sector()->ceilingz;