Allow per world configuration overrides

This commit is contained in:
stujones11 2014-08-17 17:00:52 +01:00
parent 7eebc378a6
commit 5075cc48a4
3 changed files with 12 additions and 2 deletions

View File

@ -14,6 +14,8 @@ Overall level is boosted by 10% when wearing a full matching set.
Configuration Configuration
------------- -------------
Armor can be configured by adding a file called armor.conf in 3d_armor mod directory. Armor can be configured by adding a file called armor.conf in 3d_armor mod and/or world directory.
see armor.conf.example for all available options. see armor.conf.example for all available options.
Note: worldpath config settings override any settings made in the mod's directory.

View File

@ -8,12 +8,20 @@ ARMOR_LEVEL_MULTIPLIER = 1
ARMOR_HEAL_MULTIPLIER = 1 ARMOR_HEAL_MULTIPLIER = 1
local modpath = minetest.get_modpath(ARMOR_MOD_NAME) local modpath = minetest.get_modpath(ARMOR_MOD_NAME)
local worldpath = minetest.get_worldpath()
local input = io.open(modpath.."/armor.conf", "r") local input = io.open(modpath.."/armor.conf", "r")
if input then if input then
dofile(modpath.."/armor.conf") dofile(modpath.."/armor.conf")
input:close() input:close()
input = nil input = nil
end end
input = io.open(worldpath.."/armor.conf", "r")
if input then
dofile(worldpath.."/armor.conf")
input:close()
input = nil
end
local time = 0 local time = 0
armor = { armor = {

View File

@ -17,7 +17,7 @@ when wearing a full matching set (helmet, chestplate, leggings and boots of the
Compatible with player skins [skins] by Zeg9 and Player Textures [player_textures] by PilzAdam. Compatible with player skins [skins] by Zeg9 and Player Textures [player_textures] by PilzAdam.
Armor can be configured by adding a file called armor.conf in 3d_armor mod directory. Armor can be configured by adding a file called armor.conf in 3d_armor mod or world directory.
see armor.conf.example for all available options. see armor.conf.example for all available options.
[mod] Visible Wielded Items [wieldview] [mod] Visible Wielded Items [wieldview]