Dealt with no-tag business:

* Wind/current pushers affect front sector if left untagged.
* Plane scrollers affect front sector if left untagged.

Signed-off-by: Nev3r <apophycens@gmail.com>
This commit is contained in:
Nev3r 2019-03-13 11:13:54 +01:00
parent a93e96c75b
commit cd3ea897c3

View file

@ -7693,8 +7693,14 @@ static void P_SpawnScrollers(void)
case 513: // scroll effect ceiling
case 533: // scroll and carry objects on ceiling
if (l->tag == 0)
Add_Scroller(sc_ceiling, -dx, dy, control, l->frontsector - sectors, accel, l->flags & ML_NOCLIMB);
else
{
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Scroller(sc_ceiling, -dx, dy, control, s, accel, l->flags & ML_NOCLIMB);
}
if (special != 533)
break;
/* FALLTHRU */
@ -7702,14 +7708,26 @@ static void P_SpawnScrollers(void)
case 523: // carry objects on ceiling
dx = FixedMul(dx, CARRYFACTOR);
dy = FixedMul(dy, CARRYFACTOR);
if (l->tag == 0)
Add_Scroller(sc_carry_ceiling, dx, dy, control, l->frontsector - sectors, accel, l->flags & ML_NOCLIMB);
else
{
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Scroller(sc_carry_ceiling, dx, dy, control, s, accel, l->flags & ML_NOCLIMB);
}
break;
case 510: // scroll effect floor
case 530: // scroll and carry objects on floor
if (l->tag == 0)
Add_Scroller(sc_floor, -dx, dy, control, l->frontsector - sectors, accel, l->flags & ML_NOCLIMB);
else
{
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Scroller(sc_floor, -dx, dy, control, s, accel, l->flags & ML_NOCLIMB);
}
if (special != 530)
break;
/* FALLTHRU */
@ -7717,8 +7735,14 @@ static void P_SpawnScrollers(void)
case 520: // carry objects on floor
dx = FixedMul(dx, CARRYFACTOR);
dy = FixedMul(dy, CARRYFACTOR);
if (l->tag == 0)
Add_Scroller(sc_carry, dx, dy, control, l->frontsector - sectors, accel, l->flags & ML_NOCLIMB);
else
{
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Scroller(sc_carry, dx, dy, control, s, accel, l->flags & ML_NOCLIMB);
}
break;
// scroll wall according to linedef
@ -9081,42 +9105,62 @@ static void P_SpawnPushers(void)
line_t *l = lines;
register INT32 s;
mobj_t *thing;
pushertype_e pushertype;
for (i = 0; i < numlines; i++, l++)
{
switch (l->special)
{
case 541: // wind
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Pusher(p_wind, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
pushertype = p_wind;
break;
case 544: // current
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Pusher(p_current, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
pushertype = p_current;
break;
case 547: // push/pull
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
if (l->tag == 0)
{
thing = P_GetPushThing(s);
if (thing) // No MT_P* means no effect
s = l->frontsector - sectors;
if ((thing = P_GetPushThing(s)) != NULL) // No MT_P* means no effect
Add_Pusher(p_push, l->dx, l->dy, thing, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
}
break;
else
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
{
if ((thing = P_GetPushThing(s)) != NULL) // No MT_P* means no effect
Add_Pusher(p_push, l->dx, l->dy, thing, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
}
continue;
case 545: // current up
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Pusher(p_upcurrent, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
pushertype = p_upcurrent;
break;
case 546: // current down
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Pusher(p_downcurrent, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
pushertype = p_downcurrent;
break;
case 542: // wind up
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Pusher(p_upwind, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
pushertype = p_upwind;
break;
case 543: // wind down
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Pusher(p_downwind, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
pushertype = p_downwind;
break;
default:
continue;
}
if (l->tag == 0)
Add_Pusher(pushertype, l->dx, l->dy, NULL, l->frontsector - sectors, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
else
{
for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;)
Add_Pusher(pushertype, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
}
}
}