From 86682593121953b7956894b3c30fa6e07eddedea Mon Sep 17 00:00:00 2001 From: juraj Date: Sat, 12 Mar 2016 14:34:33 +0100 Subject: [PATCH] nil check in modpath --- config.lua | 2 +- pyramids.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.lua b/config.lua index 98258da..32ace9b 100644 --- a/config.lua +++ b/config.lua @@ -210,7 +210,7 @@ MOBS_PROPS = { -- -- include mummy mobs redo addon (spawner) -if minetest.get_modpath("mobs") then +if minetest.get_modpath("mobs") ~= nil then -- enable spawner table.insert(ENABLED_MODS, "spawners") diff --git a/pyramids.lua b/pyramids.lua index 8eb721d..de8eae5 100644 --- a/pyramids.lua +++ b/pyramids.lua @@ -63,7 +63,7 @@ end function pyramids.spawn_mummy(pos, number) -- needs mobs redo - if minetest.get_modpath("mobs") then + if minetest.get_modpath("mobs") ~= nil then for i=0,number do minetest.add_entity(pos,"spawners:mummy") end @@ -72,7 +72,7 @@ end local function add_spawner(pos) -- needs mobs redo - if minetest.get_modpath("mobs") then + if minetest.get_modpath("mobs") ~= nil then minetest.set_node(pos, {name="spawners:spawners_mummy_spawner_env"}) if not minetest.setting_getbool("only_peaceful_mobs") then pyramids.spawn_mummy({x=pos.x,y=pos.y,z=pos.z-2},2) @@ -138,7 +138,7 @@ local function make(pos) minetest.after(2, pyramids.make_traps, pos) -- needs mobs redo - if minetest.get_modpath("mobs") then + if minetest.get_modpath("mobs") ~= nil then add_spawner({x=pos.x+11,y=pos.y+2, z=pos.z+16}) end