Fix action and time estimates only appearing after 2 actions (#6624)

Fixes #6623
This commit is contained in:
Davis Cook
2018-11-23 07:18:16 -05:00
committed by Tomas Slusny
parent 3c533c6136
commit c395b2b81f

View File

@@ -72,21 +72,11 @@ class XpStateSingle
private int toHourly(int value)
{
if (skillTime == 0)
{
return 0;
}
return (int) ((1.0 / (getTimeElapsedInSeconds() / 3600.0)) * value);
}
private long getTimeElapsedInSeconds()
{
if (skillTime == 0)
{
return 0;
}
// If the skill started just now, we can divide by near zero, this results in odd behavior.
// To prevent that, pretend the skill has been active for a minute (60 seconds)
// This will create a lower estimate for the first minute,