Fix TimeToMaxEnergy().
Johnny C. Lam [09-29-12 - 05:29]
Fix TimeToMaxEnergy().
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@579 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleCondition.lua b/OvaleCondition.lua
index cf8669e..eaaef92 100644
--- a/OvaleCondition.lua
+++ b/OvaleCondition.lua
@@ -2361,7 +2361,7 @@ OvaleCondition.conditions=
timetomaxenergy = function(condition)
-- TODO: temp, need to allow function calls in functions call to do things link TimeTo(Energy() == 100) which would be TimeTo(Equal(Energy(), 100))
-- TODO: This incorrect for class specializations that can exceed 100 energy.
- local t = OvaleState.currentTime + OvaleState.powerRate.energy * (100 - OvaleState.state.energy)
+ local t = OvaleState.currentTime + (100 - OvaleState.state.energy) / OvaleState.powerRate.energy
return 0, nil, 0, t, -1
end,