summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/weather.txt25
1 files changed, 11 insertions, 14 deletions
diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt
index cb426516d..631934bad 100644
--- a/npc/functions/weather.txt
+++ b/npc/functions/weather.txt
@@ -50,13 +50,13 @@ OnInit:
// Icelands
htput(.wcore, "001-7", "iceland");
+ debugmes "[Weather.sys] Total Maps = " + htsize(.wcore);
// No "end" here, so server starts with weather
OnMinute00:
OnMinute15:
OnMinute30:
OnMinute45:
- debugmes "[Weather.sys] Total Maps = " + htsize(.wcore);
.@hti = htiterator(.wcore);
for(.@key$ = htinextkey(.@hti); hticheck(.@hti); .@key$ = htinextkey(.@hti)) {
@@ -68,33 +68,28 @@ OnMinute45:
// Local variables: .@key$ .@type .@r
.@type$=htget(.wcore, .@key$);
.@r=rand(0,10000);
+ .@mk=MASK_NONE;
// Remove all current masks, and add rain/snow/sand
if (.@type$ == "desert") {
if (.@r < 10)
- setmapmask .@key$, MASK_RAIN;
+ .@mk=MASK_RAIN;
else if (.@r < 100)
- setmapmask .@key$, MASK_SANDSTORM;
- else
- setmapmask .@key$, MASK_NONE;
+ .@mk=MASK_SANDSTORM;
} else if (.@type$ == "woodland") {
if (.@r < 100)
- setmapmask .@key$, MASK_RAIN;
+ .@mk=MASK_RAIN;
else if (.@r < 120)
- setmapmask .@key$, MASK_SANDSTORM;
+ .@mk=MASK_SANDSTORM;
else if (.@r < 140)
- setmapmask .@key$, MASK_SNOW;
- else
- setmapmask .@key$, MASK_NONE;
+ .@mk=MASK_SNOW;
} else if (.@type$ == "iceland") {
if (.@r < 10)
- setmapmask .@key$, MASK_RAIN;
+ .@mk=MASK_RAIN;
else if (.@r < 100)
- setmapmask .@key$, MASK_SNOW;
- else
- setmapmask .@key$, MASK_NONE;
+ .@mk=MASK_SNOW;
} else {
debugmes "Warning warning, blame Saulc! Weather system error on map "+.@key$;
@@ -102,6 +97,8 @@ OnMinute45:
atcommand "@mapexit";
}
+ setmapmask .@key$, .@mk;
+
// Is it night time?
// For convenience, night time is from 00:15 to 00:45, every hour.
// 2 = GETTIME_MINUTE