diff --git a/src/deh_soc.c b/src/deh_soc.c index 32475d0a6..c721f20ea 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -4697,7 +4697,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_setup.cpp b/src/p_setup.cpp index 8131364c5..405d26e87 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -141,7 +141,7 @@ unsigned char mapmd5[16]; // boolean udmf; -static INT32 udmf_version; +INT32 udmf_version; size_t numvertexes, numsegs, numsectors, numsubsectors, numnodes, numlines, numsides, nummapthings; size_t num_orig_vertexes; vertex_t *vertexes; diff --git a/src/p_spec.c b/src/p_spec.c index f7f46b4e0..e8a3a5499 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3195,14 +3195,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_IsPartyPlayer(mo->player)) - P_SwitchWeather(args[0]); + else + { + if (mo && mo->player && P_IsPartyPlayer(mo->player)) + { + P_SwitchWeather(new_precip); + } + } break; + } case 425: // Calls P_SetMobjState on calling mobj { diff --git a/src/r_state.h b/src/r_state.h index 5b9303f2d..6cfcc1a09 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -64,8 +64,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;