Quantcast

Fix error in how variable quantities are added and subtracted.

Johnny C. Lam [02-09-13 - 20:17]
Fix error in how variable quantities are added and subtracted.

The values should be appropriately scaled by the origins in the case where
the quantities are "parallel" to each other.

Also fix NextTick() condition to account for the math correction.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@685 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleBestAction.lua
OvaleCondition.lua
diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua
index d7a4cbd..09e9096 100644
--- a/OvaleBestAction.lua
+++ b/OvaleBestAction.lua
@@ -576,13 +576,13 @@ function OvaleBestAction:Compute(element)
 			end
 		elseif element.operator == "+" then
 			if c+z == 0 then
-				l = a+x; m = 0; n = 0
+				l = (a+x) - (b-y)*c; m = 0; n = 0
 			else
 				l = a+x; m = (b*c+y*z)/(c+z); n = c+z
 			end
 		elseif element.operator == '-' then
 			if c-z == 0 then
-				l = a-x; m = 0; n = 0
+				l = (a-x) - (b-y)*c; m = 0; n = 0
 			else
 				l = a-x; m = (b*c-y*z)/(c-z); n = c-z
 			end
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index aa19399..b33c9f1 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -1950,7 +1950,7 @@ OvaleCondition.conditions.nexttick = function(condition)
 		while ending - tickLength > OvaleState.currentTime do
 			ending = ending - tickLength
 		end
-		return 0, nil, ending, 0, -1
+		return 0, nil, 0, ending, -1
 	end
 	return nil
 end