Moved timeUntilRegen reset-checks

This commit is contained in:
Fierelier 2018-05-15 10:00:56 +02:00
parent 5eb9b4dbb5
commit 83daeec0ae

View File

@ -55,9 +55,6 @@ namespace pdHealth
return; return;
} }
if (pl.Armor < armorVal) { timeUntilRegen = armorRegenDelay; }
if (pl.Health < healthVal) { timeUntilRegen = armorRegenDelay; }
if (allDamageArmor == true) { if (allDamageArmor == true) {
if (pl.Health < healthVal) { if (pl.Health < healthVal) {
int damageTaken = healthVal - pl.Health; int damageTaken = healthVal - pl.Health;
@ -76,6 +73,10 @@ namespace pdHealth
pl.Health = (int)Math.Round(pl.Health - ((armorVal - pl.Armor)*1.0f-armorDefense)); pl.Health = (int)Math.Round(pl.Health - ((armorVal - pl.Armor)*1.0f-armorDefense));
} }
} }
if (pl.Armor < armorVal) { timeUntilRegen = armorRegenDelay; }
if (pl.Health < healthVal) { timeUntilRegen = armorRegenDelay; }
if (timeUntilRegen > 0) { if (timeUntilRegen > 0) {
timeUntilRegen = timeUntilRegen - tickTime; timeUntilRegen = timeUntilRegen - tickTime;
if (timeUntilRegen < 0) { timeUntilRegen = 0; } if (timeUntilRegen < 0) { timeUntilRegen = 0; }