Skip to content

Commit

Permalink
Allow per world configuration overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
stujones11 committed Aug 17, 2014
1 parent 7eebc37 commit 5075cc4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion 3d_armor/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Overall level is boosted by 10% when wearing a full matching set.
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.

Note: worldpath config settings override any settings made in the mod's directory.

8 changes: 8 additions & 0 deletions 3d_armor/armor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@ ARMOR_LEVEL_MULTIPLIER = 1
ARMOR_HEAL_MULTIPLIER = 1

local modpath = minetest.get_modpath(ARMOR_MOD_NAME)
local worldpath = minetest.get_worldpath()
local input = io.open(modpath.."/armor.conf", "r")
if input then
dofile(modpath.."/armor.conf")
input:close()
input = nil
end
input = io.open(worldpath.."/armor.conf", "r")
if input then
dofile(worldpath.."/armor.conf")
input:close()
input = nil
end

local time = 0

armor = {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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.

[mod] Visible Wielded Items [wieldview]
Expand Down

0 comments on commit 5075cc4

Please sign in to comment.