fix: cleaner stage0 hack

This commit is contained in:
TrèsAbhi committed 2025-12-19 15:26:47 -06:00
1 parent 102abf49c4
commit a973cf699b
3 files changed
+5 -11

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ export default defineConfig({
outDir: "../../dist/website",
prefetch: { defaultStrategy: "hover", prefetchAll: true },
build: { concurrency: 4 },
// build: { concurrency: 4 },
adapter: target === "app" ? node({ mode: "standalone" }) : undefined,
integrations: [
@@ -188,12 +188,9 @@ function patch(stage0: StageParameters, stage1: StageParameters) {
export function aggregateStageParameters(
base: StageParameters,
stages: StageParameters[],
stage: number
stages: StageParameters[]
) {
const stage0 = StageParameters.create();
patch(stage0, base);
const stage0 = StageParameters.create({ ...base, stage_number: 0 });
/**
* Bug in Reforged: base stats are stage 1, so is the first upgrade. Manually
@@ -202,14 +199,12 @@ export function aggregateStageParameters(
* stage number to -1.
*/
if (stage0.stage_number === 0 && import.meta.env.DEV) {
if (base.stage_number === 0 && import.meta.env.DEV) {
throw new Error(
"Base stats are now stage 0. In-game bug fixed, please remove hack."
);
}
stage0.stage_number = 0;
stages.forEach((stage) => patch(stage0, stage));
return stage0;
@@ -23,8 +23,7 @@ function Content({ id }: { id: string }) {
() =>
aggregateStageParameters(
tank.base_stats!,
tank.upgrade_stages.slice(0, protagonist.stage),
protagonist.shell
tank.upgrade_stages.slice(0, protagonist.stage)
),
[protagonist]
);