omsi6.github.io icon indicating copy to clipboard operation
omsi6.github.io copied to clipboard

Analysing a core that provides no value breaks the heirloom calculator

Open bossmc opened this issue 1 year ago • 0 comments

Describe the bug I have a spire with no poison or condenser towers in it and this Common Core:

image

When I put this core into the heirloom calculator I just get:

image

And an error in the console:

image

Poking around in the console, it seems that the getModEfficiency returns 1 for both these mods (since buying them doesn't change my spire's ability to kill enemies) and hence calculatePurchases doesn't set next to anything leading to the code that fills in the "Next upgrades to buy" to try to find the full name of the mod called "", which causes the error.

The code that writes out the next upgrades to buy block checks for hasUpgradeableMods() before writing out the sections for the staff and shield, but not for the core. I think the fix is to just add a similar check for the core (possibly re-working this code so there's not 8 branches to worry about).

To Reproduce Steps to reproduce the behavior:

  • Import the attached save into the heirlooms calculator.

Expected behavior I expected the calculator to show me recommended upgrades for the shield and staff (possibly not recommending any upgrade for the core, since they won't help me).

Screenshots If applicable, add screenshots to help explain your problem.

Savefile

https://pastebin.com/MyjC3LkV

bossmc avatar Nov 16 '23 21:11 bossmc