Fix regression with heal_multiplier config

This commit is contained in:
stujones11 2017-04-09 16:25:52 +01:00
parent e5e926a02e
commit a76a35f177
3 changed files with 5 additions and 7 deletions

@ -59,10 +59,6 @@ armor_level_multiplier = 1
-- eg: armor_heal_multiplier = 0 will disable healing altogether.
armor_heal_multiplier = 1
-- You can use this to increase or decrease overall armor radiation protection,
-- eg: armor_radiation_multiplier = 0 will completely disable radiation protection.
armor_radiation_multiplier = 1
-- Enable water protection (periodically restores breath when activated)
armor_water_protect = true
@ -111,7 +107,7 @@ armor:register_armor("mod_name:speed_boots", {
armor_groups = {fleshy=10, radiation=10},
damage_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1},
reciprocate_damage = true,
on_destroy = function(player, item_name)
on_destroy = function(player, stack)
local pos = player:getpos()
if pos then
minetest.sound_play({
@ -150,7 +146,9 @@ on_destroy = func(player, stack)
on_damage = func(player, stack)
on_punch = func(player, hitter, time_from_last_punch, tool_capabilities)
Notes: on_punch is called every time the player takes damage, `hitter`,
Notes:
`on_punch` is called every time a player is punched or takes damage, `hitter`,
`time_from_last_punch` and `tool_capabilities` can be `nil` and will be in the
case of fall damage, etc. Return `false` to override armor damage effects.
When armor is destroyed `stack` will contain a copy of the previous stack.

@ -58,7 +58,6 @@ armor.config = {
destroy = false,
level_multiplier = 1,
heal_multiplier = 1,
radiation_multiplier = 1,
material_wood = true,
material_cactus = true,
material_steel = true,

@ -295,6 +295,7 @@ minetest.register_on_player_hpchange(function(player, hp_change)
local name = player:get_player_name()
if name and armor.def[name] then
local heal = armor.def[name].heal or 0
heal = heal * armor.config.heal_multiplier
if heal >= math.random(100) then
hp_change = 0
end