Fix Krumblor on Steam

This commit is contained in:
Daniël van Noord
2021-09-06 15:43:41 +02:00
parent b191d9a434
commit 4be3942af3
5 changed files with 6 additions and 5 deletions

View File

@@ -14,7 +14,8 @@ export default function CacheDragonCost() {
Game.dragonLevel < 25 &&
Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice')
) {
let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
const objectMatch = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/);
let target = objectMatch !== null ? objectMatch[1] : Game.ObjectsById[Game.dragonLevel-5].name;
const amount = Game.dragonLevels[Game.dragonLevel].buy
.toString()
.match(/sacrifice\((.*?)\)/)[1];