diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 3e2384a3e..445873639 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -469,7 +469,7 @@ void moveplayers(void) act->SetHitOwner(act); if (ud.god == 0) - if (fi.ceilingspace(spri->sectnum) || fi.floorspace(spri->sectnum)) + if (fi.ceilingspace(spri->sector()) || fi.floorspace(spri->sector())) quickkill(p); } else @@ -5015,11 +5015,11 @@ void makeitfall(DDukeActor* actor) auto s = actor->s; int c; - if( fi.floorspace(s->sectnum) ) + if( fi.floorspace(s->sector()) ) c = 0; else { - if( fi.ceilingspace(s->sectnum) || s->sector()->lotag == ST_2_UNDERWATER) + if( fi.ceilingspace(s->sector()) || s->sector()->lotag == ST_2_UNDERWATER) c = gs.gravity/6; else c = gs.gravity; } @@ -5266,11 +5266,11 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO int c; int sphit = fallspecial? fallspecial(actor, playernum) : 0; - if (fi.floorspace(s->sectnum)) + if (fi.floorspace(s->sector())) c = 0; else { - if (fi.ceilingspace(s->sectnum) || s->sector()->lotag == 2) + if (fi.ceilingspace(s->sector()) || s->sector()->lotag == 2) c = gs.gravity / 6; else c = gs.gravity; } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index c158cd7da..61fc966b5 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -104,11 +104,11 @@ void SerializeActorGlobals(FSerializer& arc) // //--------------------------------------------------------------------------- -bool ceilingspace_d(int sectnum) +bool ceilingspace_d(sectortype* sectp) { - if( (sector[sectnum].ceilingstat&1) && sector[sectnum].ceilingpal == 0 ) + if( (sectp->ceilingstat&1) && sectp->ceilingpal == 0 ) { - switch(sector[sectnum].ceilingpicnum) + switch(sectp->ceilingpicnum) { case MOONSKY1: case BIGORBIT1: @@ -124,11 +124,11 @@ bool ceilingspace_d(int sectnum) // //--------------------------------------------------------------------------- -bool floorspace_d(int sectnum) +bool floorspace_d(sectortype* sectp) { - if( (sector[sectnum].floorstat&1) && sector[sectnum].ceilingpal == 0 ) + if( (sectp->floorstat&1) && sectp->ceilingpal == 0 ) { - switch(sector[sectnum].floorpicnum) + switch(sectp->floorpicnum) { case MOONSKY1: case BIGORBIT1: @@ -1002,10 +1002,10 @@ void movefallers_d(void) ssp(act, CLIPMASK0); } - if (fi.floorspace(s->sectnum)) x = 0; + if (fi.floorspace(s->sector())) x = 0; else { - if (fi.ceilingspace(s->sectnum)) + if (fi.ceilingspace(s->sector())) x = gs.gravity / 6; else x = gs.gravity; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index c6cb4a4ca..71a37f562 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -51,11 +51,11 @@ void resetlanepics(void); // //--------------------------------------------------------------------------- -bool ceilingspace_r(int sectnum) +bool ceilingspace_r(sectortype* sectp) { - if( (sector[sectnum].ceilingstat&1) && sector[sectnum].ceilingpal == 0 ) + if( (sectp->ceilingstat&1) && sectp->ceilingpal == 0 ) { - switch(sector[sectnum].ceilingpicnum) + switch(sectp->ceilingpicnum) { case MOONSKY1: case BIGORBIT1: @@ -65,17 +65,18 @@ bool ceilingspace_r(int sectnum) return 0; } + //--------------------------------------------------------------------------- // // // //--------------------------------------------------------------------------- -bool floorspace_r(int sectnum) +bool floorspace_r(sectortype* sectp) { - if( (sector[sectnum].floorstat&1) && sector[sectnum].ceilingpal == 0 ) + if( (sectp->floorstat&1) && sectp->ceilingpal == 0 ) { - switch(sector[sectnum].floorpicnum) + switch(sectp->floorpicnum) { case MOONSKY1: case BIGORBIT1: @@ -856,10 +857,10 @@ void movefallers_r(void) } int x; - if (fi.floorspace(s->sectnum)) x = 0; + if (fi.floorspace(s->sector())) x = 0; else { - if (fi.ceilingspace(s->sectnum)) + if (fi.ceilingspace(s->sector())) x = gs.gravity / 6; else x = gs.gravity; diff --git a/source/games/duke/src/dispatch.cpp b/source/games/duke/src/dispatch.cpp index 0a617c345..351e5ebc2 100644 --- a/source/games/duke/src/dispatch.cpp +++ b/source/games/duke/src/dispatch.cpp @@ -56,10 +56,10 @@ void checkhitsprite_r(DDukeActor* i, DDukeActor* sn); void checksectors_d(int snum); void checksectors_r(int snum); -bool ceilingspace_d(int sectnum); -bool ceilingspace_r(int sectnum); -bool floorspace_d(int sectnum); -bool floorspace_r(int sectnum); +bool ceilingspace_d(sectortype*); +bool ceilingspace_r(sectortype*); +bool floorspace_d(sectortype*); +bool floorspace_r(sectortype*); void addweapon_d(struct player_struct* p, int weapon); void addweapon_r(struct player_struct* p, int weapon); void hitradius_d(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4); diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 8e8f4dfd2..fcdb53009 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -88,8 +88,8 @@ struct Dispatcher void (*checkhitsprite)(DDukeActor* i, DDukeActor* sn); void (*checksectors)(int low); - bool (*ceilingspace)(int sectnum); - bool (*floorspace)(int sectnum); + bool (*ceilingspace)(sectortype* sectp); + bool (*floorspace)(sectortype* sectp); void (*addweapon)(struct player_struct *p, int weapon); void (*hitradius)(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4); void (*lotsofmoney)(DDukeActor *s, short n); diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 939da3ecd..e93671908 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -2511,7 +2511,7 @@ int ParseState::parse(void) } break; case concmd_ifinspace: - parseifelse(fi.ceilingspace(g_sp->sectnum)); + parseifelse(fi.ceilingspace(g_sp->sector())); break; case concmd_spritepal: @@ -2811,7 +2811,7 @@ int ParseState::parse(void) insptr++; break; case concmd_ifinouterspace: - parseifelse( fi.floorspace(g_sp->sectnum)); + parseifelse( fi.floorspace(g_sp->sector())); break; case concmd_ifnotmoving: parseifelse( (g_ac->movflag&kHitTypeMask) > kHitSector );