Skip to content

Commit 1998993

Browse files
committed
Fix: skip sorting vaulted upgrades
1 parent 3ca9c7e commit 1998993

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
## [2042.12] - 2021-09-21
810
### Added
911
- Auto increase decimalPlaces for small number.
1012

1113
### Changed
12-
- Change: Rollback the algorithm about deltaTime.
14+
- Change: rollback the algorithm about deltaTime.
1315
- Improve: tweak layout of buildings.
1416

1517
### Fixed
16-
- Fix: sort tech upgrades in their own list.
18+
- Fix: sort tech upgrades in their own list.
19+
- Fix: skip sorting vaulted upgrades.
1720

1821
## [2042.11] - 2021-09-19
1922
### Added

RELEASE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
## [2042.11] - 2021-09-19
1+
## [2042.12] - 2021-09-21
22
### Added
3-
- Add: Highlight pre-deal that can advance best-deal waiting time.
4-
- Add: Waiting time for deals.
3+
- Auto increase decimalPlaces for small number.
54

65
### Changed
7-
- Change: calc deltaTime from price / deltaCps
6+
- Change: rollback the algorithm about deltaTime.
7+
- Improve: tweak layout of buildings.
8+
9+
### Fixed
10+
- Fix: sort tech upgrades in their own list.
11+
- Fix: skip sorting vaulted upgrades.

info.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"ID": "Best Deal Helper",
44
"Author": "Jethro Yu",
55
"Description": "Help you choose best deal!",
6-
"ModVersion": 2042.11,
6+
"ModVersion": 2042.12,
77
"GameVersion": 2.042,
8-
"Date": "19/09/2021",
8+
"Date": "21/09/2021",
99
"Dependencies": ["CCSE"],
1010
"Disabled": 1,
1111
"AllowSteamAchievs": 1

main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/**
2626
* @typedef {Object} Upgrade
2727
* @property {function} getPrice
28+
* @property {function} isVaulted
2829
* @property {number} bought
2930
* @property {number} timeToTargetCookie
3031
* @property {number} newCookiesPs
@@ -144,6 +145,7 @@ let BestDealHelper = {
144145
// Treat Grandmapocalypse upgrade as 0% temporary
145146
if (["One mind", "Communal brainsweep", "Elder pact"].includes(me.name)
146147
|| me.pool === "toggle"
148+
|| (me.isVaulted && me.isVaulted())
147149
|| Game.cookies === 0) {
148150
return 0;
149151
}
@@ -381,8 +383,8 @@ let BestDealHelper = {
381383
let buildUpgrades = document.querySelector("#upgrades");
382384
let techUpgrades = document.querySelector("#techUpgrades");
383385
upgrades.forEach(function (upgrade) {
384-
if (upgrade.pool === "toggle") {
385-
} else if (upgrade.pool === "tech") {
386+
if (upgrade.pool === "toggle" || upgrade.isVaulted()) return;
387+
if (upgrade.pool === "tech") {
386388
techUpgrades.appendChild(upgrade.l);
387389
} else {
388390
buildUpgrades.appendChild(upgrade.l);

0 commit comments

Comments
 (0)