mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-13 22:33:32 +00:00
Merge branch 'udmf-conveyor-flip' into 'next'
Automatically apply flipspecial to upside-down FOF conveyor belts See merge request STJr/SRB2!1827
This commit is contained in:
commit
fa4394b3ad
1 changed files with 21 additions and 0 deletions
21
src/p_spec.c
21
src/p_spec.c
|
@ -7476,6 +7476,17 @@ void T_Scroll(scroll_t *s)
|
||||||
} // end of switch
|
} // end of switch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean IsSector3DBlock(sector_t* sec)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
for (i = 0; i < sec->linecount; i++)
|
||||||
|
{
|
||||||
|
if (sec->lines[i]->special >= 100 && sec->lines[i]->special < 300)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** Adds a generalized scroller to the thinker list.
|
/** Adds a generalized scroller to the thinker list.
|
||||||
*
|
*
|
||||||
* \param type The enumerated type of scrolling.
|
* \param type The enumerated type of scrolling.
|
||||||
|
@ -7489,6 +7500,7 @@ void T_Scroll(scroll_t *s)
|
||||||
*/
|
*/
|
||||||
static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT32 affectee, INT32 accel, INT32 exclusive)
|
static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT32 affectee, INT32 accel, INT32 exclusive)
|
||||||
{
|
{
|
||||||
|
boolean is3dblock = IsSector3DBlock(§ors[affectee]);
|
||||||
scroll_t *s = Z_Calloc(sizeof *s, PU_LEVSPEC, NULL);
|
scroll_t *s = Z_Calloc(sizeof *s, PU_LEVSPEC, NULL);
|
||||||
s->thinker.function.acp1 = (actionf_p1)T_Scroll;
|
s->thinker.function.acp1 = (actionf_p1)T_Scroll;
|
||||||
s->type = type;
|
s->type = type;
|
||||||
|
@ -7502,7 +7514,16 @@ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT3
|
||||||
s->last_height = sectors[control].floorheight + sectors[control].ceilingheight;
|
s->last_height = sectors[control].floorheight + sectors[control].ceilingheight;
|
||||||
s->affectee = affectee;
|
s->affectee = affectee;
|
||||||
if (type == sc_carry || type == sc_carry_ceiling)
|
if (type == sc_carry || type == sc_carry_ceiling)
|
||||||
|
{
|
||||||
sectors[affectee].specialflags |= SSF_CONVEYOR;
|
sectors[affectee].specialflags |= SSF_CONVEYOR;
|
||||||
|
if (is3dblock)
|
||||||
|
{
|
||||||
|
if (type == sc_carry)
|
||||||
|
sectors[affectee].flags |= MSF_FLIPSPECIAL_CEILING;
|
||||||
|
else
|
||||||
|
sectors[affectee].flags |= MSF_FLIPSPECIAL_FLOOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
P_AddThinker(THINK_MAIN, &s->thinker);
|
P_AddThinker(THINK_MAIN, &s->thinker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue