From d05cda6da48aebb0e3513045e30c0f4136952e10 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 26 Apr 2015 17:29:06 -0400 Subject: do not accept negative values in humantime --- world/map/npc/functions/time.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'world/map/npc') diff --git a/world/map/npc/functions/time.txt b/world/map/npc/functions/time.txt index 7d16a200..bd80a1b1 100644 --- a/world/map/npc/functions/time.txt +++ b/world/map/npc/functions/time.txt @@ -75,6 +75,7 @@ function|script|HumanTime if(@seconds) set @ms, @ms + (@seconds * 1000); if(@minutes) set @ms, @ms + (@minutes * 60000); if(@days) set @ms, @ms + (@days * 1440000); + if(@ms < 0) goto L_TooShort; if(@ms < 1000) goto L_Millis; // under 1 second we have nothing to count set @seconds, @ms / 1000; set @ms, @ms % 1000; @@ -90,6 +91,10 @@ function|script|HumanTime if(@days) goto L_Days; goto L_Clean; +L_TooShort: + debugmes "HumanTime: negative value: "+@ms; + mapexit; + L_Millis: set @time$, @ms + "ms"; return; -- cgit v1.2.3-60-g2f50