Quantcast

Fix error in using "more" or "less" with decreasing values.

Author Johnny C. Lam <jlam88@gmail.com>
Author date 2013-03-12 04:46:04
Author local date 2013-03-12 04:46:04 +0000
Committer Johnny C. Lam <jlam88@gmail.com>
Committer date 2013-03-12 04:46:04
Committer local date 2013-03-12 04:46:04 +0000
Commit 167e8a84444735444f17acbbf7c08580cf7b2512
Tree 2a341d4cec45f7224980ac27894acbe495590b01
Parent 111d3bcd72b7a8ad133ec2844da3f451d1878f74
Fix error in using "more" or "less" with decreasing values.

When using a script condition that has a decreasing value, e.g.,
BuffRemains(), the value is a function

    f(t) = value + (t - origin) * rate

where rate is negative.  When using the "more"/"less" comparators, e.g.,
BuffRemains(more 3), this effectively solves the following inequality:

    f(t) = value + (t - origin) * rate > 3

When the rate is negative, the inequality is reversed, and you end up
with:

   t < (3 - value)/rate + origin

Prior to this commit, Ovale was using the wrong answer of:

   t > (3 - value)/rate + origin

This had broken scripts that were using the verbose method of comparing
values.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@751 d5049fe3-3747-40f7-a4b5-f36d6801af5f