mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-24 21:31:46 +00:00
Adapt "change plane scroller direction" linedef type to UDMF
This commit is contained in:
parent
6dfca597c5
commit
805bafd936
3 changed files with 27 additions and 3 deletions
|
@ -2462,6 +2462,21 @@ udmf
|
|||
enum = "floorceiling";
|
||||
}
|
||||
}
|
||||
|
||||
435
|
||||
{
|
||||
title = "Change Plane Scroller Direction";
|
||||
prefix = "(435)";
|
||||
arg0
|
||||
{
|
||||
title = "Target sector tag";
|
||||
type = 13;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Speed";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
linedefexecplane
|
||||
|
|
|
@ -3611,6 +3611,10 @@ static void P_ConvertBinaryMap(void)
|
|||
}
|
||||
lines[i].special = 429;
|
||||
break;
|
||||
case 435: //Change plane scroller direction
|
||||
lines[i].args[0] = tag;
|
||||
lines[i].args[1] = R_PointToDist2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y) >> FRACBITS;
|
||||
break;
|
||||
case 443: //Call Lua function
|
||||
if (lines[i].text)
|
||||
{
|
||||
|
|
11
src/p_spec.c
11
src/p_spec.c
|
@ -2945,17 +2945,22 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
scroll_t *scroller;
|
||||
thinker_t *th;
|
||||
|
||||
fixed_t length = R_PointToDist2(line->v2->x, line->v2->y, line->v1->x, line->v1->y);
|
||||
fixed_t speed = line->args[1] << FRACBITS;
|
||||
fixed_t dx = FixedMul(FixedMul(FixedDiv(line->dx, length), speed) >> SCROLL_SHIFT, CARRYFACTOR);
|
||||
fixed_t dy = FixedMul(FixedMul(FixedDiv(line->dy, length), speed) >> SCROLL_SHIFT, CARRYFACTOR);
|
||||
|
||||
for (th = thlist[THINK_MAIN].next; th != &thlist[THINK_MAIN]; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 != (actionf_p1)T_Scroll)
|
||||
continue;
|
||||
|
||||
scroller = (scroll_t *)th;
|
||||
if (!Tag_Find(§ors[scroller->affectee].tags, tag))
|
||||
if (!Tag_Find(§ors[scroller->affectee].tags, line->args[0]))
|
||||
continue;
|
||||
|
||||
scroller->dx = FixedMul(line->dx>>SCROLL_SHIFT, CARRYFACTOR);
|
||||
scroller->dy = FixedMul(line->dy>>SCROLL_SHIFT, CARRYFACTOR);
|
||||
scroller->dx = dx;
|
||||
scroller->dy = dy;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue