Skip to content
Snippets Groups Projects
Commit 2afea367 authored by MascaraSnake's avatar MascaraSnake
Browse files

Apply flipspecial automatically to ceiling carry effects

parent d2f2c716
No related branches found
No related tags found
No related merge requests found
...@@ -7474,6 +7474,17 @@ void T_Scroll(scroll_t *s) ...@@ -7474,6 +7474,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.
...@@ -7487,6 +7498,7 @@ void T_Scroll(scroll_t *s) ...@@ -7487,6 +7498,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(&sectors[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;
...@@ -7500,7 +7512,13 @@ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT3 ...@@ -7500,7 +7512,13 @@ 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 ((type == sc_carry_ceiling) ^ is3dblock)
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);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment