-
Notifications
You must be signed in to change notification settings - Fork 34
Error in laitela.js maxAllDarkMatterDimensions command #123
Copy link
Copy link
Open
Labels
Class: PatchFixes something that was brokenFixes something that was brokenEasyShould be relatively easy to implement. If you are a new to coding, you should work on these.Should be relatively easy to implement. If you are a new to coding, you should work on these.Focus: CelestialThis affects something to do with celestialsThis affects something to do with celestialsHigh PriorityWe should get this done ASAPWe should get this done ASAPRequirement: HighThis is a MUST for refactorThis is a MUST for refactorScale: SmallThis will only directly impact itself or adjacent codeThis will only directly impact itself or adjacent code
Description
Metadata
Metadata
Assignees
Labels
Class: PatchFixes something that was brokenFixes something that was brokenEasyShould be relatively easy to implement. If you are a new to coding, you should work on these.Should be relatively easy to implement. If you are a new to coding, you should work on these.Focus: CelestialThis affects something to do with celestialsThis affects something to do with celestialsHigh PriorityWe should get this done ASAPWe should get this done ASAPRequirement: HighThis is a MUST for refactorThis is a MUST for refactorScale: SmallThis will only directly impact itself or adjacent codeThis will only directly impact itself or adjacent code
The function maxAllDarkMatterDimensions in laitela.js uses a command to find all unlocked DMDs, then buys the maximum number of upgrades available for these DMDs. The issue occurs only in some rare situations, the most common being a Dark Matter Dimension autobuyer being unlocked for a Dark Matter Dimension that isn’t yet unlocked, and sometimes will occur in post-END mods. The reason this issue occurs is because the for loop only purchases upgrades for DMDs that are unlocked, however the for loop will repeat for every DMD autobuyer that is unlocked via the Singularity Milestone (or when called manually with an index higher than the unlocked DMDs). It will try to purchase upgrades for DMDs that register in the loop as “undefined”, thus crashing the game with the error “Uncaught TypeError: Cannot read properties of undefined (reading 'buyManyInterval')”. The fix is quite simple: Instead of having the loop repeat for every unlocked autobuyer, it should only repeat for every unlocked DMD. You can change the instance of “maxTier” on laitela.js lines 90, 93 and 96 to “unlockedDimensions.length” and the issue should be fixed.