From f2b2e8dc1fc87232bb413ccda46bca631e394075 Mon Sep 17 00:00:00 2001 From: sapier Date: Thu, 31 Jan 2013 20:01:43 +0000 Subject: [PATCH] make mob restore storage world specific --- mobf/generic_functions.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mobf/generic_functions.lua b/mobf/generic_functions.lua index c005617..d278a99 100644 --- a/mobf/generic_functions.lua +++ b/mobf/generic_functions.lua @@ -914,8 +914,11 @@ end --! @param value to save ------------------------------------------------------------------------------- function mobf_set_world_setting(name,value) - minetest.setting_set(name,value) + --TODO replace by lua supported world settings storage + local worldid = minetest.get_worldpath() + local access_name = "mobf_" .. worldid .. "_ " .. name + minetest.setting_set(access_name,value) end ------------------------------------------------------------------------------- @@ -926,7 +929,11 @@ end --! @param name key to use for storage ------------------------------------------------------------------------------- function mobf_get_world_setting(name) - return minetest.setting_get(name) + + --TODO replace by lua supported world settings storage + local worldid = minetest.get_worldpath() + local access_name = "mobf_" .. worldid .. "_ " .. name + return minetest.setting_get(access_name) end ------------------------------------------------------------------------------- -- name: mobf_fixed_size_string(text,length)