Quantcast

allows division

Sidoine De Wispelaere [08-30-12 - 19:13]
allows division

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@519 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleBestAction.lua
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index 814cfb2..74655bf 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -556,12 +556,11 @@ function OvaleBestAction:Compute(element)
 				l = a-x; m = (b*c-y*z)/(c-z); n = c-z
 			end
 		elseif element.operator == '/' then
-			if z == 0 then
-				l = a/x; m = b; n = c/x
-			else
-				Ovale:Print("ERROR: second value of / must be constant")
-				Ovale.bug = true
+			if z ~= 0 then
+				-- To allow constructs like target.Health()/target.DeadIn()
+				x = x + (OvaleState.currentTime - y) * z
 			end
+			l = a/x; m = b; n = c/x
 		elseif element.operator == '%' then
 			if c == 0 and z == 0 then
 				l = c % z; m = 0; n = 0