From 51e530f8617ce8a1e1588b9a55ea510c94b4bd13 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Sun, 29 Jun 2025 16:37:10 -0400 Subject: [PATCH] Fix weather not properly getting read from SOC --- src/deh_soc.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/deh_soc.c b/src/deh_soc.c index 588069f2a..1bbcb90b9 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -4147,18 +4147,16 @@ menudrawer_f *get_menudrawer(const char *word) }*/ preciptype_t get_precip(const char *word) -{ // Returns the value of PRECIP_ enumerations - preciptype_t i; +{ + // Returns the value of PRECIP_ enumerations if (*word >= '0' && *word <= '9') return atoi(word); - if (fastncmp("PRECIP_",word,4)) - word += 7; // take off the PRECIP_ - for (i = 0; i < MAXPRECIP; i++) + if (fastncmp("PRECIP_",word,7)) { - if (precipprops[i].name == NULL) - break; - if (fasticmp(word, precipprops[i].name)) - return i; + fixed_t eval = LUA_EvalMath(word); + + if (eval) + return eval; } deh_warning("Couldn't find weather type named 'PRECIP_%s'",word); return PRECIP_NONE;