From 56033e898815904f704e04526e463e6741aa9c7b Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Sat, 27 May 2017 17:26:42 -0700 Subject: [PATCH] Set variables 'sneaker.modname' & 'sneaker.modpath' --- init.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 466069b..ebbb9f7 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,15 @@ sneaker = {} +sneaker.modname = minetest.get_current_modname() +sneaker.modpath = minetest.get_modpath(sneaker.modname) -dofile(minetest.get_modpath('sneaker')..'/tnt_function.lua') -dofile(minetest.get_modpath('sneaker')..'/spawn.lua') +local scripts = { + 'tnt_function', + 'spawn', + } + +for I in pairs(scripts) do + dofile(sneaker.modpath .. '/' .. scripts[I] .. '.lua') +end local function jump(self,pos,direction) local velocity = self.object:getvelocity()