Limit cooldowns to a minimum of 1 tick and replace armour cooldown reductions with correct values, fixes #603

This commit is contained in:
Electroblob77
2021-01-31 15:50:55 +00:00
parent bba9fb68e6
commit cd6fa03990
2 changed files with 5 additions and 2 deletions
@@ -251,6 +251,7 @@ public final class WandHelper {
for(int i = 0; i < cooldowns.length; i++){
if(cooldowns[i] > 0) cooldowns[i]--;
if(cooldowns[i] < 0) cooldowns[i] = 0; // In case it got broken
}
setCooldowns(wand, cooldowns);
@@ -312,6 +313,8 @@ public final class WandHelper {
// cast, which is impossible if there are no spells.
if(cooldowns.length <= selectedSpell) cooldowns = new int[spellCount];
if(cooldown <= 0) cooldown = 1;
cooldowns[selectedSpell] = cooldown;
setCooldowns(wand, cooldowns);