Automatic mod names for all but rotary, hack for sz_heat fire sfx.

This commit is contained in:
Aaron Suen 2013-11-08 20:22:42 -05:00
parent bd49896452
commit b4a2a1345f
3 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,9 @@ dofile(minetest.get_modpath(minetest.get_current_modname())
.. "/sz_class.lua");
-- Load subclasses defined in this mod.
sz_class:loadsubclasses("sz_table")
sz_class:loadsubclasses(
"sz_table"
)
sz_table:loadsubclasses(
"sz_pos",
"sz_facedir"

View File

@ -8,7 +8,8 @@ function sz_class:new(init)
end
function sz_class:loadlibs(...)
local modpath = minetest.get_modpath(minetest.get_current_modname()) .. "/";
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname) .. "/";
for i, class in ipairs({...}) do
dofile(modpath .. class .. ".lua")
end

View File

@ -240,7 +240,7 @@ end
-- A safe accessor to get the groups for the node definition
-- at this location that will always return a table.
function sz_pos:groups()
return (self:nodedef() or { }).groups or { }
return sz_table:new((self:nodedef() or { }).groups or { })
end
-- Return true if this location contains only air.