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; } + } } }