aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advtrains_luaautomation/environment.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua
index 5bf7527..e0bfa69 100644
--- a/advtrains_luaautomation/environment.lua
+++ b/advtrains_luaautomation/environment.lua
@@ -58,8 +58,14 @@ local function safe_print(t, ...)
minetest.chat_send_all(str)
end
-local function safe_date()
- return(os.date("*t",os.time()))
+local function safe_date(f, t)
+ if not f then
+ -- fall back to old behavior
+ return(os.date("*t",os.time()))
+ else
+ --pass parameters
+ return os.date(f,t)
+ end
end
-- string.rep(str, n) with a high value for n can be used to DoS