mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 17:22:12 +00:00
Merge branch 'fof-sector-special-fixes' into 'next'
FOF sector special fixes See merge request STJr/SRB2!242
This commit is contained in:
commit
a3d8ceb9e5
3 changed files with 50 additions and 1 deletions
|
@ -2103,6 +2103,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
|||
boolean floortouch = false;
|
||||
fixed_t bottomheight, topheight;
|
||||
msecnode_t *node;
|
||||
ffloor_t *rover;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
@ -2150,6 +2151,19 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
|||
{
|
||||
targetsec = §ors[targetsecnum];
|
||||
|
||||
// Find the FOF corresponding to the control linedef
|
||||
for (rover = targetsec->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (rover->master == sec->lines[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (!rover) // This should be impossible, but don't complain if it is the case somehow
|
||||
continue;
|
||||
|
||||
if (!(rover->flags & FF_EXISTS)) // If the FOF does not "exist", we pretend that nobody's there
|
||||
continue;
|
||||
|
||||
for (j = 0; j < MAXPLAYERS; j++)
|
||||
{
|
||||
if (!playeringame[j])
|
||||
|
|
27
src/p_spec.c
27
src/p_spec.c
|
@ -6628,6 +6628,7 @@ void T_Scroll(scroll_t *s)
|
|||
line_t *line;
|
||||
size_t i;
|
||||
INT32 sect;
|
||||
ffloor_t *rover;
|
||||
|
||||
case sc_side: // scroll wall texture
|
||||
side = sides + s->affectee;
|
||||
|
@ -6669,6 +6670,19 @@ void T_Scroll(scroll_t *s)
|
|||
sector_t *psec;
|
||||
psec = sectors + sect;
|
||||
|
||||
// Find the FOF corresponding to the control linedef
|
||||
for (rover = psec->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (rover->master == sec->lines[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (!rover) // This should be impossible, but don't complain if it is the case somehow
|
||||
continue;
|
||||
|
||||
if (!(rover->flags & FF_EXISTS)) // If the FOF does not "exist", we pretend that nobody's there
|
||||
continue;
|
||||
|
||||
for (node = psec->touching_thinglist; node; node = node->m_thinglist_next)
|
||||
{
|
||||
thing = node->m_thing;
|
||||
|
@ -6732,6 +6746,19 @@ void T_Scroll(scroll_t *s)
|
|||
sector_t *psec;
|
||||
psec = sectors + sect;
|
||||
|
||||
// Find the FOF corresponding to the control linedef
|
||||
for (rover = psec->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (rover->master == sec->lines[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (!rover) // This should be impossible, but don't complain if it is the case somehow
|
||||
continue;
|
||||
|
||||
if (!(rover->flags & FF_EXISTS)) // If the FOF does not "exist", we pretend that nobody's there
|
||||
continue;
|
||||
|
||||
for (node = psec->touching_thinglist; node; node = node->m_thinglist_next)
|
||||
{
|
||||
thing = node->m_thing;
|
||||
|
|
10
src/p_user.c
10
src/p_user.c
|
@ -1621,6 +1621,9 @@ boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space
|
|||
|
||||
for (rover = sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if (GETSECSPECIAL(rover->master->frontsector->special, 1) != SPACESPECIAL)
|
||||
continue;
|
||||
#ifdef ESLOPE
|
||||
|
@ -1835,6 +1838,12 @@ static void P_CheckBouncySectors(player_t *player)
|
|||
|
||||
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue; // FOFs should not be bouncy if they don't even "exist"
|
||||
|
||||
if (GETSECSPECIAL(rover->master->frontsector->special, 1) != 15)
|
||||
continue; // this sector type is required for FOFs to be bouncy
|
||||
|
||||
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
|
||||
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
|
||||
|
||||
|
@ -1848,7 +1857,6 @@ static void P_CheckBouncySectors(player_t *player)
|
|||
&& oldz + player->mo->height > P_GetFOFBottomZ(player->mo, node->m_sector, rover, oldx, oldy, NULL))
|
||||
top = false;
|
||||
|
||||
if (GETSECSPECIAL(rover->master->frontsector->special, 1) == 15)
|
||||
{
|
||||
fixed_t linedist;
|
||||
|
||||
|
|
Loading…
Reference in a new issue