fishpondstudio/CivIdle

Percentage of Transportation Workers in Statistics Building is broken

Closed this issue · 7 comments

@insraq This code got change last week.

                     mReduceOf(
                        gameState.transportation,
                        (prev, k, v) => prev + v.reduce((prev, curr) => prev + curr.currentFuelAmount, 0),
                        0,
                     ) / Tick.current.workersUsed.get("Power")!,

From this!!

                     mReduceOf(
                        gameState.transportation,
                        (prev, k, v) => prev + v.reduce((prev, curr) => prev + curr.currentFuelAmount, 0),
                        0,
                     ) / Tick.current.workersUsed.Worker!,

Oh, that's wrong. It should be Tick.current.workersUsed.get("Worker")

Do you want to make a PR? I am on the 0.3 branch

PR for main or 0.3?

Main I assume.

Not sure how they have that big a number, mine is NaN

This should be fixed in main.
If you have power, then it will show a big number (which is wrong, it's using power instead of worker)

PR here #124