Skip to content

Commit

Permalink
Move shields level reduction to shields mod
Browse files Browse the repository at this point in the history
  • Loading branch information
stujones11 committed Mar 29, 2017
1 parent 3aac5c9 commit 5911447
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions 3d_armor/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,10 @@ armor.set_player_armor = function(self, player)
end
for group, level in pairs(levels) do
if level > 0 then
if minetest.get_modpath("shields") then
level = level * 0.9
end
level = level * armor.config.level_multiplier
if material.name and material.count == #self.elements then
level = level * 1.1
end
level = level * armor.config.level_multiplier
end
local base = self.registered_groups[group]
self.def[name].groups[group] = level
Expand Down
2 changes: 2 additions & 0 deletions shields/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ local use_moreores = minetest.get_modpath("moreores")

if minetest.global_exists("armor") and armor.elements then
table.insert(armor.elements, "shield")
local mult = armor.config.level_multiplier or 1
armor.config.level_multiplier = mult * 0.9
end

-- Regisiter Shields
Expand Down

0 comments on commit 5911447

Please sign in to comment.