Level_SetWeather: Use str instead of int
This commit is contained in:
parent
d674634875
commit
ce7d345e44
3 changed files with 23 additions and 5 deletions
|
|
@ -4140,7 +4140,7 @@ preciptype_t get_precip(const char *word)
|
|||
return i;
|
||||
}
|
||||
deh_warning("Couldn't find weather type named 'PRECIP_%s'",word);
|
||||
return PRECIP_RAIN;
|
||||
return PRECIP_NONE;
|
||||
}
|
||||
|
||||
/// \todo Make ANY of this completely over-the-top math craziness obey the order of operations.
|
||||
|
|
|
|||
23
src/p_spec.c
23
src/p_spec.c
|
|
@ -2926,14 +2926,31 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
|
|||
break;
|
||||
|
||||
case 424: // Change Weather
|
||||
{
|
||||
preciptype_t new_precip = PRECIP_NONE;
|
||||
if (udmf_version < 2)
|
||||
{
|
||||
new_precip = args[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
new_precip = stringargs[0] ? get_number(stringargs[0]) : PRECIP_NONE;
|
||||
}
|
||||
|
||||
if (args[1])
|
||||
{
|
||||
globalweather = (UINT8)(args[0]);
|
||||
globalweather = new_precip;
|
||||
P_SwitchWeather(globalweather);
|
||||
}
|
||||
else if (mo && mo->player && P_IsLocalPlayer(mo->player))
|
||||
P_SwitchWeather(args[0]);
|
||||
else
|
||||
{
|
||||
if (mo && mo->player && P_IsLocalPlayer(mo->player))
|
||||
{
|
||||
P_SwitchWeather(new_precip);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 425: // Calls P_SetMobjState on calling mobj
|
||||
if (mo && !mo->player)
|
||||
|
|
|
|||
|
|
@ -63,8 +63,9 @@ extern size_t numspritelumps, max_spritelumps;
|
|||
//
|
||||
// Lookup tables for map data.
|
||||
//
|
||||
#define UDMF_CURRENT_VERSION (1)
|
||||
#define UDMF_CURRENT_VERSION (2)
|
||||
extern boolean udmf;
|
||||
extern INT32 udmf_version;
|
||||
|
||||
extern size_t numsprites;
|
||||
extern spritedef_t *sprites;
|
||||
|
|
|
|||
Loading…
Reference in a new issue