[mob_bear] init.lua: Use check for modpath "factions" before referencing

global variable "factions".
This commit is contained in:
AntumDeluge 2016-08-12 10:15:18 -07:00
parent 66c0cb3741
commit 57b7fd0909

View File

@ -200,9 +200,11 @@ mobf_spawner_register("bear_spawner_1",bear_name,
collisionbox = selectionbox_bear
})
if factions~= nil and
type(factions.set_base_reputation) == "function" then
factions.set_base_reputation("bears","players",-25)
local FACTIONSDIR = minetest.get_modpath("factions")
if FACTIONSDIR then
if factions~= nil and type(factions.set_base_reputation) == "function" then
factions.set_base_reputation("bears","players",-25)
end
end
minetest.log("action","\tadding mob "..bear_prototype.name)