Fix action and time estimates only appearing after 2 actions (#6624)
Fixes #6623
This commit is contained in:
@@ -72,21 +72,11 @@ class XpStateSingle
|
|||||||
|
|
||||||
private int toHourly(int value)
|
private int toHourly(int value)
|
||||||
{
|
{
|
||||||
if (skillTime == 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (int) ((1.0 / (getTimeElapsedInSeconds() / 3600.0)) * value);
|
return (int) ((1.0 / (getTimeElapsedInSeconds() / 3600.0)) * value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getTimeElapsedInSeconds()
|
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.
|
// 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)
|
// To prevent that, pretend the skill has been active for a minute (60 seconds)
|
||||||
// This will create a lower estimate for the first minute,
|
// This will create a lower estimate for the first minute,
|
||||||
|
|||||||
Reference in New Issue
Block a user