Fix bugs with EC! and respec+load

This commit is contained in:
SpectralFlame 2023-07-23 22:43:05 -05:00 committed by cyip92
parent 561c8cfc9c
commit d0a167a5fd
2 changed files with 3 additions and 3 deletions

View File

@ -177,8 +177,7 @@ export default {
if (this.respecAndLoad && Player.canEternity) {
player.respec = true;
const tree = new TimeStudyTree(this.truncatedInput);
animateAndEternity(() =>
TimeStudyTree.commitToGameState(tree.purchasedStudies, false, this.combinedTree.startEC));
animateAndEternity(() => TimeStudyTree.commitToGameState(tree.purchasedStudies, false, tree.startEC));
return;
}
this.importTree();

View File

@ -240,7 +240,8 @@ export class TimeStudyTree {
if (checkOnlyStructure) {
return reqSatisfied && !hasForbiddenStudies;
}
const hasEnoughTT = Currency.timeTheorems.value.subtract(this.spentTheorems[0]).gte(study.cost);
const totalTT = player.timestudy.theorem.plus(TimeTheorems.calculateTimeStudiesCost());
const hasEnoughTT = totalTT.subtract(this.spentTheorems[0]).gte(study.cost);
const secondaryGoal = Perk.studyECRequirement.isBought || study.isEntryGoalMet;
return reqSatisfied && !hasForbiddenStudies && (study.isBought || (secondaryGoal && hasEnoughTT));
}