Ovale Spell Priority

12 - Rounding error in Mana() script function for energy, leading to icon flickering

Using 3.3.14 release.
This only concern energy-using classes, that is, rogues and feral druids.

Here is a nasty bug i've found:

The Mana() function predict the time when requested amount of energy will be available.
To do so, it is using current system time, and current amount of energy that player have.

Here comes the trick: It is unknown when last energy tick actually was, compared to current system time.
It maybe so that the tick have just came, and it is going to be another 0.1 secs before next one will come. Or it could be that the next tick is just about to happen. And that purely depends on the moment when the GetTime() was called, which is random.
As result, there is a possible error in prediction that Mana function is doing, and that error can be up to 0.1 seconds.

Basically, if at some moment the Mana() function gave you one prediction, then half-second later it can give you a different one, up to 0.1 secs different.
All the icon timer checks use 0.01 tolerances, so when a different prediction comes, the icon thinks that something has changed, and restart the Cooldown timer, thus inducing the flickering.

The math.cell() call inside Mana() function doesn't make it better - it just make it so the prediction can be off by a full second.

I do not know what to do here, on my local machine the best i could do was to remove math.cell() and increase time comparison tolerances to 0.1 instead of 0.01.

Just thought i could share that find, since i liked your addon and would like to see it getting better.

User When Change
Sidoine Oct 04, 2010 at 18:19 UTC Changed status from Accepted to Declined
Sidoine Jan 17, 2010 at 09:51 UTC Changed status from New to Accepted
Stringer123 Jan 16, 2010 at 19:11 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of Sidoine Sidoine Jan 17, 2010 at 12:50 UTC - 0 likes

    Could you try r204 please? Druid and rogue are the two classes (well, mage too) that I was not able to play beyond the first levels so I can't test this.

  • 1 comment

Facts

Last updated
Oct 04, 2010
Reported
Jan 16, 2010
Status
Declined - We decided not to take action on this ticket.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees