diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 3db5dd68f..626632844 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -2363,7 +2363,7 @@ void PlayerOperateEnv(PLAYERp pp) DoSlidorOperate(pp, pp->cursector()); break; case TAG_SPRING_BOARD: - DoSpringBoard(pp/*, pp->cursectnum*/); + DoSpringBoard(pp); pp->KeyPressBits &= ~SB_OPEN; break; case TAG_DOOR_ROTATE: @@ -2386,7 +2386,7 @@ void PlayerOperateEnv(PLAYERp pp) // //////////////////////////// SECTORp sectp = pp->cursector(); - if (pp->cursectnum >= 0 && sectp->hasU() && sectp->damage) + if (pp->insector() && sectp->hasU() && sectp->damage) { if (TEST(sectp->flags, SECTFU_DAMAGE_ABOVE_SECTOR)) { @@ -2413,11 +2413,11 @@ void PlayerOperateEnv(PLAYERp pp) OperateContinuousTrigger(pp); // just changed sectors - if (pp->lastcursectnum != pp->cursectnum) + if (pp->lastcursector() != pp->cursector()) { OperateTripTrigger(pp); - if (pp->cursectnum >= 0 && TEST(pp->cursector()->extra, SECTFX_WARP_SECTOR)) + if (pp->insector() && TEST(pp->cursector()->extra, SECTFX_WARP_SECTOR)) { if (!TEST(pp->Flags2, PF2_TELEPORTED)) { diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 0ce51c313..5f6053bb6 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -1635,7 +1635,6 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny) // THIS WAS CAUSING PROLEMS!!!! // Sectors are still being manipulated so you can end up in a void (-1) sector - //updatesector(pp->posx, pp->posy, &pp->cursectnum); // New angle is formed by taking last known angle and // adjusting by the delta angle diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 078a98afc..539afe32f 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -2760,9 +2760,9 @@ int DoLavaErupt(DSWActor* actor) TRAVERSE_CONNECT(pnum) { pp = Player + pnum; - if (pp->cursectnum >= 0 && TEST(pp->cursector()->extra, SECTFX_TRIGGER)) + if (pp->insector() && TEST(pp->cursector()->extra, SECTFX_TRIGGER)) { - SWSectIterator it(pp->cursectnum); + SWSectIterator it(pp->cursector()); while (auto itActor = it.Next()) { tsp = &itActor->s(); diff --git a/source/games/sw/src/zombie.cpp b/source/games/sw/src/zombie.cpp index e4f7c2ba2..53606e080 100644 --- a/source/games/sw/src/zombie.cpp +++ b/source/games/sw/src/zombie.cpp @@ -784,7 +784,7 @@ void SpawnZombie(PLAYERp pp, DSWActor* weaponActor) auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], pp->cursector(), pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0); np = &actorNew->s(); nu = actorNew->u(); - np->sectnum = pp->cursectnum; + np->setsector(pp->cursector()); SetOwner(actorNew, ownerActor); np->pal = nu->spal = ownerActor->u()->spal; np->ang = RANDOM_P2(2048);