From 6bd4804acb823d5767d490fd358ba585e2331811 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 15 May 2018 10:24:55 +0200 Subject: [PATCH] Made armor-regenaration disableable --- paydayHealth.cs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/paydayHealth.cs b/paydayHealth.cs index 40caea5..809dbce 100644 --- a/paydayHealth.cs +++ b/paydayHealth.cs @@ -75,16 +75,18 @@ namespace pdHealth } } - if (pl.Armor < armorVal) { timeUntilRegen = armorRegenDelay; } - if (pl.Health < healthVal) { timeUntilRegen = armorRegenDelay; } - - if (timeUntilRegen > 0) { - timeUntilRegen = timeUntilRegen - tickTime; - if (timeUntilRegen < 0) { timeUntilRegen = 0; } - } else { - if (pl.Armor < armorRegen) { - pl.Armor = pl.Armor + armorRegenSpeed; - if (pl.Armor > armorRegen) { pl.Armor = armorRegen; } + if (armorRegen > 0) { + if (pl.Armor < armorVal) { timeUntilRegen = armorRegenDelay; } + if (pl.Health < healthVal) { timeUntilRegen = armorRegenDelay; } + + if (timeUntilRegen > 0) { + timeUntilRegen = timeUntilRegen - tickTime; + if (timeUntilRegen < 0) { timeUntilRegen = 0; } + } else { + if (pl.Armor < armorRegen) { + pl.Armor = pl.Armor + armorRegenSpeed; + if (pl.Armor > armorRegen) { pl.Armor = armorRegen; } + } } }