aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-02-22 12:52:33 +0100
committerorwell96 <orwell@bleipb.de>2019-02-22 12:52:33 +0100
commite5c4e8cc1fdc17f016a5a1956041ddc5cd0d407d (patch)
tree8448601dd386f8eecf623e63d1d78a6ed04f42a3
parent086b2c0fb030a6a678046568d0b5542c0e3f6e5d (diff)
downloadadvtrains-e5c4e8cc1fdc17f016a5a1956041ddc5cd0d407d.tar.gz
advtrains-e5c4e8cc1fdc17f016a5a1956041ddc5cd0d407d.tar.bz2
advtrains-e5c4e8cc1fdc17f016a5a1956041ddc5cd0d407d.zip
Lift restrictions for date() function in atlatc
-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