Set SSF_WINDCURRENT and SSF_CONVEYOR automatically if there's a pusher/conveyor

This commit is contained in:
MascaraSnake 2021-12-31 13:58:41 +01:00
parent 2b4d32b372
commit eef7763d68
5 changed files with 9 additions and 33 deletions

View file

@ -437,8 +437,6 @@ sectortypes
144 = "Egg Capsule";
160 = "Special Stage Time/Spheres Parameters <deprecated>";
176 = "Custom Global Gravity <deprecated>";
512 = "Wind/Current";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
4096 = "Star Post Activator";
8192 = "Exit/Special Stage Pit/Return Flag";
@ -497,8 +495,6 @@ gen_sectortypes
third
{
0 = "Normal";
512 = "Wind/Current";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
}

View file

@ -87,8 +87,6 @@ sectorflags
outerspace = "Space Countdown";
doublestepup = "Ramp Sector (double step-up/down)";
nostepdown = "Non-Ramp Sector (No step-down)";
windcurrent = "Wind/Current";
conveyor = "Conveyor Belt";
speedpad = "Speed Pad";
starpostactivator = "Star Post Activator";
exit = "Exit";

View file

@ -27,8 +27,6 @@ sectortypes
144 = "Egg Capsule";
160 = "Special Stage Time/Spheres Parameters <deprecated>";
176 = "Custom Global Gravity <deprecated>";
512 = "Wind/Current";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
4096 = "Star Post Activator";
8192 = "Exit/Special Stage Pit/Return Flag";
@ -85,8 +83,6 @@ gen_sectortypes
third
{
0 = "Normal";
512 = "Wind/Current";
1024 = "Conveyor Belt";
1280 = "Speed Pad";
}

View file

@ -1691,10 +1691,6 @@ static void ParseTextmapSectorParameter(UINT32 i, char *param, char *val)
sectors[i].specialflags |= SSF_DOUBLESTEPUP;
else if (fastcmp(param, "nostepdown") && fastcmp("true", val))
sectors[i].specialflags |= SSF_NOSTEPDOWN;
else if (fastcmp(param, "windcurrent") && fastcmp("true", val))
sectors[i].specialflags |= SSF_WINDCURRENT;
else if (fastcmp(param, "conveyor") && fastcmp("true", val))
sectors[i].specialflags |= SSF_CONVEYOR;
else if (fastcmp(param, "speedpad") && fastcmp("true", val))
sectors[i].specialflags |= SSF_SPEEDPAD;
else if (fastcmp(param, "starpostactivator") && fastcmp("true", val))
@ -5207,12 +5203,6 @@ static void P_ConvertBinaryMap(void)
switch(GETSECSPECIAL(sectors[i].special, 3))
{
case 2: //Wind/Current
sectors[i].specialflags |= SSF_WINDCURRENT;
break;
case 4: //Conveyor belt
sectors[i].specialflags |= SSF_CONVEYOR;
break;
case 5: //Speed pad
sectors[i].specialflags |= SSF_SPEEDPAD;
break;

View file

@ -7471,9 +7471,12 @@ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT3
s->accel = accel;
s->exclusive = exclusive;
s->vdx = s->vdy = 0;
if ((s->control = control) != -1)
s->control = control;
if (s->control != -1)
s->last_height = sectors[control].floorheight + sectors[control].ceilingheight;
s->affectee = affectee;
if (type == sc_carry || type == sc_carry_ceiling)
sectors[affectee].specialflags |= SSF_CONVEYOR;
P_AddThinker(THINK_MAIN, &s->thinker);
}
@ -8407,9 +8410,13 @@ static void Add_Pusher(pushertype_e type, fixed_t x_mag, fixed_t y_mag, fixed_t
{
p->roverpusher = true;
p->referrer = referrer;
sectors[referrer].specialflags |= SSF_WINDCURRENT;
}
else
{
p->roverpusher = false;
sectors[affectee].specialflags |= SSF_WINDCURRENT;
}
p->affectee = affectee;
P_AddThinker(THINK_MAIN, &p->thinker);
@ -8437,19 +8444,8 @@ void T_Pusher(pusher_t *p)
z_mag = p->z_mag >> PUSH_FACTOR;
sec = sectors + p->affectee;
// Be sure the sector special flag is still turned on. If so, proceed.
// Else, bail out; the flag has been changed on us.
if (p->roverpusher)
{
referrer = &sectors[p->referrer];
if (!(referrer->specialflags & SSF_WINDCURRENT))
return;
}
else if (!(sec->specialflags & SSF_WINDCURRENT))
return;
referrer = sectors + p->referrer;
// For constant pushers (wind/current) there are 3 situations:
//