Adapt linedef types 423 and 424 to UDMF

This commit is contained in:
MascaraSnake 2021-09-20 12:42:31 +02:00
parent d2eb4587c2
commit 4028d392b0
3 changed files with 53 additions and 5 deletions

View file

@ -2891,6 +2891,49 @@ udmf
}
}
423
{
title = "Change Sky";
prefix = "(423)";
arg0
{
title = "Sky number";
}
arg1
{
title = "For all players?";
type = 11;
enum = "noyes";
}
}
424
{
title = "Change Weather";
prefix = "(424)";
arg0
{
title = "Weather";
type = 11;
enum
{
0 = "None";
1 = "Storm (thunder, lightning and rain)";
2 = "Snow";
3 = "Rain";
4 = "Preloaded";
5 = "Storm (no rain)";
6 = "Storm (no lightning)";
}
}
arg1
{
title = "For all players?";
type = 11;
enum = "noyes";
}
}
443
{
title = "Call Lua Function";

View file

@ -3775,6 +3775,11 @@ static void P_ConvertBinaryMap(void)
case 421: //Stop lighting effect
lines[i].args[0] = tag;
break;
case 423: //Change sky
case 424: //Change weather
lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
lines[i].args[1] = !!(lines[i].flags & ML_NOCLIMB);
break;
case 428: //Start platform movement
lines[i].args[0] = tag;
lines[i].args[1] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;

View file

@ -2560,18 +2560,18 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
break;
case 423: // Change Sky
if ((mo && mo->player && P_IsLocalPlayer(mo->player)) || (line->flags & ML_NOCLIMB))
P_SetupLevelSky(sides[line->sidenum[0]].textureoffset>>FRACBITS, (line->flags & ML_NOCLIMB));
if ((mo && mo->player && P_IsLocalPlayer(mo->player)) || line->args[1])
P_SetupLevelSky(line->args[0], line->args[1]);
break;
case 424: // Change Weather
if (line->flags & ML_NOCLIMB)
if (line->args[1])
{
globalweather = (UINT8)(sides[line->sidenum[0]].textureoffset>>FRACBITS);
globalweather = (UINT8)(line->args[0]);
P_SwitchWeather(globalweather);
}
else if (mo && mo->player && P_IsLocalPlayer(mo->player))
P_SwitchWeather(sides[line->sidenum[0]].textureoffset>>FRACBITS);
P_SwitchWeather(line->args[0]);
break;
case 425: // Calls P_SetMobjState on calling mobj