Quantcast

fix in < and > operators

Sidoine De Wispelaere [08-14-12 - 08:14]
fix in < and > operators

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@486 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleBestAction.lua
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index cccbe52..f514624 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -474,8 +474,8 @@ function OvaleBestAction:Compute(element)
 			-- a + (t-b)*c = x + (t-y)*z
 			-- (t-b)*c - (t-y)*z = x - a
 			-- t*c - b*c - t*z + y*z = x - a
-			-- t*(c-z) = x - a + b*c + y*z
-			-- t = (x-a + b*c + y*z)/(c-z)
+			-- t*(c-z) = x - a + b*c - y*z
+			-- t = (x-a + b*c - y*z)/(c-z)
 			if c == z then
 				if a-b*c < x-y*z then
 					return 0
@@ -483,7 +483,7 @@ function OvaleBestAction:Compute(element)
 					return nil
 				end
 			else
-				local t = (x-a + b*c + y*z)/(c-z)
+				local t = (x-a + b*c - y*z)/(c-z)
 				if c > z then
 					return 0, t
 				else
@@ -500,7 +500,7 @@ function OvaleBestAction:Compute(element)
 					return nil
 				end
 			else
-				local t = (x-a + b*c + y*z)/(c-z)
+				local t = (x-a + b*c - y*z)/(c-z)
 				if c < z then
 					return 0, t
 				else