diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index c6ead1096..4a6972f4a 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -41,7 +41,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms BEGIN_SW_NS ANIMATOR InitActorRunToward; -bool FAF_Sector(int sectnum); bool DropAhead(DSWActor* actor, int min_height); ANIMATORp ChooseAction(DECISION decision[]); diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 4d1e8ca1a..6626fe46f 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -2059,7 +2059,6 @@ void computergetinput(int snum,InputPacket *syn); // jplayer.c void DrawOverlapRoom(int tx,int ty,int tz,fixed_t tq16ang,fixed_t tq16horiz,short tsectnum); // rooms.c void SetupMirrorTiles(void); // rooms.c -bool FAF_Sector(int sectnum); // rooms.c bool FAF_Sector(sectortype* sectnum); // rooms.c int GetZadjustment(sectortype* sectnum,short hitag); // rooms.c diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 735c4993f..8ab4414ce 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -462,7 +462,7 @@ int DoBloodSpray(DSWActor* actor) else { auto bsp = &bldActor->s(); - if (FAF_Sector(bsp->sectnum) || FAF_ConnectArea(bsp->sector())) + if (FAF_Sector(bsp->sector()) || FAF_ConnectArea(bsp->sector())) { KillActor(actor); return 0; diff --git a/source/games/sw/src/quake.cpp b/source/games/sw/src/quake.cpp index 987298cac..66b4d8f8f 100644 --- a/source/games/sw/src/quake.cpp +++ b/source/games/sw/src/quake.cpp @@ -233,11 +233,11 @@ void QuakeViewChange(PLAYERp pp, int *z_diff, int *x_diff, int *y_diff, short *a } } -void SpawnQuake(short sectnum, int x, int y, int z, +void SpawnQuake(sectortype* sect, int x, int y, int z, short tics, short amt, int radius) { - auto actorNew = InsertActor(sectnum, STAT_QUAKE_ON); + auto actorNew = InsertActor(sect, STAT_QUAKE_ON); auto sp = &actorNew->s(); sp->x = x; @@ -259,7 +259,7 @@ void SpawnQuake(short sectnum, int x, int y, int z, bool SetQuake(PLAYERp pp, short tics, short amt) { - SpawnQuake(pp->cursectnum, pp->posx, pp->posy, pp->posz, tics, amt, 30000); + SpawnQuake(pp->cursector(), pp->posx, pp->posy, pp->posz, tics, amt, 30000); return false; } @@ -268,7 +268,7 @@ SetExpQuake(DSWActor* actor) { SPRITEp sp = &actor->s(); - SpawnQuake(sp->sectnum, sp->x, sp->y, sp->z, 40, 4, 20000); // !JIM! was 8, 40000 + SpawnQuake(sp->sector(), sp->x, sp->y, sp->z, 40, 4, 20000); // !JIM! was 8, 40000 return 0; } @@ -277,7 +277,7 @@ SetGunQuake(DSWActor* actor) { SPRITEp sp = &actor->s(); - SpawnQuake(sp->sectnum, sp->x, sp->y, sp->z, 40, 8, 40000); + SpawnQuake(sp->sector(), sp->x, sp->y, sp->z, 40, 8, 40000); return 0; } @@ -285,7 +285,7 @@ SetGunQuake(DSWActor* actor) int SetPlayerQuake(PLAYERp pp) { - SpawnQuake(pp->cursectnum, pp->posx, pp->posy, pp->posz, 40, 8, 40000); + SpawnQuake(pp->cursector(), pp->posx, pp->posy, pp->posz, 40, 8, 40000); return 0; } @@ -295,7 +295,7 @@ SetNuclearQuake(DSWActor* actor) { SPRITEp sp = &actor->s(); - SpawnQuake(sp->sectnum, sp->x, sp->y, sp->z, 400, 8, 64000); + SpawnQuake(sp->sector(), sp->x, sp->y, sp->z, 400, 8, 64000); return 0; } @@ -303,7 +303,7 @@ int SetSumoQuake(DSWActor* actor) { SPRITEp sp = &actor->s(); - SpawnQuake(sp->sectnum, sp->x, sp->y, sp->z, 120, 4, 20000); + SpawnQuake(sp->sector(), sp->x, sp->y, sp->z, 120, 4, 20000); return 0; } @@ -311,7 +311,7 @@ int SetSumoFartQuake(DSWActor* actor) { SPRITEp sp = &actor->s(); - SpawnQuake(sp->sectnum, sp->x, sp->y, sp->z, 60, 4, 4000); + SpawnQuake(sp->sector(), sp->x, sp->y, sp->z, 60, 4, 4000); return 0; } diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index ac1c511c8..800f2ad53 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -81,25 +81,6 @@ DSWActor* InsertActor(int sectnum, int stat) return pActor; } -bool FAF_Sector(int sectnum) -{ - SPRITEp sp; - - SWSectIterator it(sectnum); - while (auto actor = it.Next()) - { - sp = &actor->s(); - - if (sp->statnum == STAT_FAF && - (sp->hitag >= VIEW_LEVEL1 && sp->hitag <= VIEW_LEVEL6)) - { - return true; - } - } - - return false; -} - bool FAF_Sector(sectortype* sectnum) { SPRITEp sp;