Move optional bug fixes to separate config section

This commit is contained in:
Sainan 2025-06-24 02:10:39 +02:00
parent 636d3100f3
commit 91773082af
4 changed files with 25 additions and 4 deletions

View File

@ -25,6 +25,10 @@
"dontSubtractPurchaseStandingCost": false,
"dontSubtractVoidTraces": false,
"dontSubtractConsumables": false,
"bugFixes": {
"ignore1999LastRegionPlayed": false,
"fixXtraCheeseTimer": false
},
"unlockAllShipFeatures": false,
"unlockAllShipDecorations": false,
"unlockAllFlavourItems": false,

View File

@ -65,6 +65,10 @@ export interface IConfig {
unlockAllSimarisResearchEntries?: boolean;
spoofMasteryRank?: number;
nightwaveStandingMultiplier?: number;
bugFixes?: {
ignore1999LastRegionPlayed?: boolean;
fixXtraCheeseTimer?: boolean;
};
worldState?: {
creditBoost?: boolean;
affinityBoost?: boolean;

View File

@ -268,7 +268,9 @@ export const addMissionInventoryUpdates = async (
addMissionComplete(inventory, value);
break;
case "LastRegionPlayed":
inventory.LastRegionPlayed = value;
if (!(config.bugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) {
inventory.LastRegionPlayed = value;
}
break;
case "RawUpgrades":
addMods(inventory, value);

View File

@ -1325,6 +1325,17 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
const cheeseInterval = hourInSeconds * 8;
const cheeseDuration = hourInSeconds * 2;
const cheeseIndex = Math.trunc(timeSecs / cheeseInterval);
let cheeseStart = cheeseIndex * cheeseInterval;
let cheeseEnd = cheeseStart + cheeseDuration;
let cheeseNext = (cheeseIndex + 1) * cheeseInterval;
// Live servers only update the start time once it happens, which makes the
// client show a negative countdown during off-hours. Optionally adjust the
// times so the next activation is always in the future.
if (config.bugFixes?.fixXtraCheeseTimer && timeSecs >= cheeseEnd) {
cheeseStart = cheeseNext;
cheeseEnd = cheeseStart + cheeseDuration;
cheeseNext += cheeseInterval;
}
const tmp: ITmp = {
cavabegin: "1690761600",
PurchasePlatformLockEnabled: true,
@ -1349,9 +1360,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
ennnd: true,
mbrt: true,
fbst: {
a: cheeseIndex * cheeseInterval, // This has a bug where the client shows a negative time for "Xtra cheese starts in ..." until it refreshes the world state. This is because we're only providing the new activation as soon as that time/date is reached. However, this is 100% faithful to live.
e: cheeseIndex * cheeseInterval + cheeseDuration,
n: (cheeseIndex + 1) * cheeseInterval
a: cheeseStart,
e: cheeseEnd,
n: cheeseNext
},
sfn: [550, 553, 554, 555][halfHour % 4]
};