From c46b1384170e49ffec21bf0842c5062ea3f86279 Mon Sep 17 00:00:00 2001 From: Lejo1 Date: Sun, 18 Aug 2019 19:39:59 +0200 Subject: [PATCH] Fix never happen error --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0c3dede..b43bcad 100644 --- a/init.lua +++ b/init.lua @@ -5,7 +5,10 @@ local current = {} local storage = minetest.get_mod_storage() function playtime.get_current_playtime(name) - return os.time() - current[name] + if current[name] then + return os.time() - current[name] + else return 0 + end end -- Function to get playtime