diff --git a/src/deh_soc.c b/src/deh_soc.c index a8dd1799c..0e7ca8857 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -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. diff --git a/src/p_spec.c b/src/p_spec.c index c9ebe781c..f6f740e44 100644 --- a/src/p_spec.c +++ b/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) diff --git a/src/r_state.h b/src/r_state.h index 2de829c39..5398bcc20 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -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;