mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- pass a sector pointer to floorspace/ceilingspace.
This commit is contained in:
parent
060da8ec1d
commit
d45f687d4b
6 changed files with 30 additions and 29 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue