Skip to content

Analysing a core that provides no value breaks the heirloom calculator #81

@bossmc

Description

@bossmc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugx thing stops working when I do y, x thing says it gives y but it doesn't

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions