Quantcast

Fix rate of change of spell charges in SpellCharges() script condition.

Johnny C. Lam [01-01-15 - 14:19]
Fix rate of change of spell charges in SpellCharges() script condition.

The rate was incorrectly set to 1, which led to (very) inaccurate
estimates of the number of fractional spell charges.  This fixes the
Shield Block usage for protection warriors.
Filename
conditions.lua
diff --git a/conditions.lua b/conditions.lua
index b1b116a..e771c01 100644
--- a/conditions.lua
+++ b/conditions.lua
@@ -4766,7 +4766,7 @@ do
 		charges = charges or 0
 		maxCharges = maxCharges or 1
 		if condition.count == 0 and charges < maxCharges then
-			return TestValue(state.currentTime, INFINITY, charges + 1, start + duration, 1, comparator, limit)
+			return TestValue(state.currentTime, INFINITY, charges + 1, start + duration, 1 / duration, comparator, limit)
 		end
 		return Compare(charges, comparator, limit)
 	end