bitburner-official / bitburner-src

Bitburner source code.
Other
847 stars 274 forks source link

BLADE: Fix population estimate percent growth when estimate is 0 #1620

Closed Faenre closed 3 months ago

Faenre commented 3 months ago

BLADE: Fix population estimate percent growth when estimate is 0

In Bladeburners, there are 4 methods to improve the player's population estimate, 3 of which are percentage-based. However, if the estimate is at 0.00000 population, then Field Analysis, Investigation, and Undercover Operation are all unable to improve estimate counts, even if the actual estimate recovers.

This PR clamps the estimate change to a minimum of +1 in the circumstance that the actual population is a positive number and the estimated population is less.

This does NOT change the percentage calculations, it only clamps that a "too low" population estimate increase is guaranteed to discover at least 1.00 new synthoid.

Tested by reducing Sector 12 to 0 and then letting passive population growth kick in during bonus time.

Before: image

After: image

Bug fix

d0sboots commented 3 months ago

I have an alternate plan here, but I want to grab the comment fixes and the min is a step in the right direction, so I'm gonna take this as-is.