From 752b6e43a6f0f8fb210e7b36ca6a4995e345df0d Mon Sep 17 00:00:00 2001 From: Brett Tasker Date: Tue, 23 Jun 2026 21:09:35 +1200 Subject: [PATCH 1/5] Change default spawn phase pet for pest farming --- .../src/player/pestfarmingplayer.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/farming-weight/src/player/pestfarmingplayer.ts b/packages/farming-weight/src/player/pestfarmingplayer.ts index 50427f21..896b13e7 100644 --- a/packages/farming-weight/src/player/pestfarmingplayer.ts +++ b/packages/farming-weight/src/player/pestfarmingplayer.ts @@ -1,4 +1,5 @@ -import { CROP_INFO, Crop } from '../constants/crops.js'; +import { Crop, CROP_INFO } from '../constants/crops.js'; +import { FarmingPets } from '../constants/pets.js'; import { CROP_FARMING_STATS, PEST_FARMING_STATS, Stat, type StatBreakdown, VACUUM_STATS } from '../constants/stats.js'; import type { EffectSummary, @@ -485,9 +486,17 @@ export class PestFarmingPlayer { return result; } - private pickBestPetId(_phase: PestFarmingPhase): string | undefined { + private pickBestPetId(phase: PestFarmingPhase): string | undefined { const selectedUuid = this.options.selectedPet?.pet.uuid ?? undefined; - return selectedUuid ?? this.inventory.selectedPet?.pet.uuid ?? this.inventory.pets[0]?.pet.uuid ?? undefined; + const defaultUuid = selectedUuid ?? this.inventory.selectedPet?.pet.uuid ?? this.inventory.pets[0]?.pet.uuid ?? undefined; + switch(phase) { + case PestFarmingPhase.Spawn: + return this.inventory.pets.find(pet => pet.type === FarmingPets.Mosquito)?.pet.uuid ?? + this.inventory.pets.find(pet => pet.type === FarmingPets.Slug)?.pet.uuid ?? + defaultUuid; + default: + return defaultUuid; + } } private findArmor(slot: GearSlot, uuid: string): FarmingArmor | undefined { From c820fd6a1e4279a205092446dfaef30fab75da3a Mon Sep 17 00:00:00 2001 From: Brett Tasker Date: Tue, 30 Jun 2026 14:41:54 +1200 Subject: [PATCH 2/5] Fix linting --- .../farming-weight/src/player/pestfarmingplayer.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/farming-weight/src/player/pestfarmingplayer.ts b/packages/farming-weight/src/player/pestfarmingplayer.ts index 896b13e7..2443d25f 100644 --- a/packages/farming-weight/src/player/pestfarmingplayer.ts +++ b/packages/farming-weight/src/player/pestfarmingplayer.ts @@ -1,4 +1,4 @@ -import { Crop, CROP_INFO } from '../constants/crops.js'; +import { CROP_INFO, Crop } from '../constants/crops.js'; import { FarmingPets } from '../constants/pets.js'; import { CROP_FARMING_STATS, PEST_FARMING_STATS, Stat, type StatBreakdown, VACUUM_STATS } from '../constants/stats.js'; import type { @@ -488,12 +488,15 @@ export class PestFarmingPlayer { private pickBestPetId(phase: PestFarmingPhase): string | undefined { const selectedUuid = this.options.selectedPet?.pet.uuid ?? undefined; - const defaultUuid = selectedUuid ?? this.inventory.selectedPet?.pet.uuid ?? this.inventory.pets[0]?.pet.uuid ?? undefined; + const defaultUuid = + selectedUuid ?? this.inventory.selectedPet?.pet.uuid ?? this.inventory.pets[0]?.pet.uuid ?? undefined; switch(phase) { case PestFarmingPhase.Spawn: - return this.inventory.pets.find(pet => pet.type === FarmingPets.Mosquito)?.pet.uuid ?? - this.inventory.pets.find(pet => pet.type === FarmingPets.Slug)?.pet.uuid ?? - defaultUuid; + return ( + this.inventory.pets.find((pet) => pet.type === FarmingPets.Mosquito)?.pet.uuid ?? + this.inventory.pets.find((pet) => pet.type === FarmingPets.Slug)?.pet.uuid ?? + defaultUuid + ); default: return defaultUuid; } From af5549754fd8f2c9910ce23e1bd01cf717d21185 Mon Sep 17 00:00:00 2001 From: Brett Tasker Date: Tue, 30 Jun 2026 14:55:57 +1200 Subject: [PATCH 3/5] Additional linting fixes --- packages/farming-weight/src/player/pestfarmingplayer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/farming-weight/src/player/pestfarmingplayer.ts b/packages/farming-weight/src/player/pestfarmingplayer.ts index 2443d25f..44c22b89 100644 --- a/packages/farming-weight/src/player/pestfarmingplayer.ts +++ b/packages/farming-weight/src/player/pestfarmingplayer.ts @@ -490,7 +490,7 @@ export class PestFarmingPlayer { const selectedUuid = this.options.selectedPet?.pet.uuid ?? undefined; const defaultUuid = selectedUuid ?? this.inventory.selectedPet?.pet.uuid ?? this.inventory.pets[0]?.pet.uuid ?? undefined; - switch(phase) { + switch (phase) { case PestFarmingPhase.Spawn: return ( this.inventory.pets.find((pet) => pet.type === FarmingPets.Mosquito)?.pet.uuid ?? From 36d139d90790215e865e47df677d0af412bbab1f Mon Sep 17 00:00:00 2001 From: Brett Tasker Date: Wed, 1 Jul 2026 21:28:43 +1200 Subject: [PATCH 4/5] Use ProfitCalculator to determine best pet for each phase --- .../src/pests/pest-farming-rate-calculator.ts | 42 +++++++++- .../src/pests/pest-rate-types.ts | 6 ++ .../src/player/pestfarmingplayer.ts | 16 +--- src/lib/stores/ratesData.ts | 2 +- .../[[profile]]/pest-farming/+page.svelte | 21 +++-- .../pest-farming-context.svelte.ts | 80 +++++++++++++------ 6 files changed, 117 insertions(+), 50 deletions(-) diff --git a/packages/farming-weight/src/pests/pest-farming-rate-calculator.ts b/packages/farming-weight/src/pests/pest-farming-rate-calculator.ts index 21534054..04117a29 100644 --- a/packages/farming-weight/src/pests/pest-farming-rate-calculator.ts +++ b/packages/farming-weight/src/pests/pest-farming-rate-calculator.ts @@ -4,7 +4,8 @@ import { Stat } from '../constants/stats.js'; import type { FortuneUpgrade } from '../constants/upgrades.js'; import { resolveDropEffects } from '../effects/resolver.js'; import type { DropTag } from '../effects/types.js'; -import { PestFarmingPhase, type PestFarmingPlayer } from '../player/pestfarmingplayer.js'; +import type { FarmingPet } from '../fortune/farmingpet.js'; +import { createPestFarmingPlayer, PestFarmingPhase, type PestFarmingPlayer } from '../player/pestfarmingplayer.js'; import type { DetailedDropsFromEffectsResult } from '../util/ratecalc-effects.js'; import { calculatePestCropDropAmount, @@ -32,6 +33,7 @@ import type { PestRateValuationDelta, PestRateValuationResult, PestSpawnDistribution, + PetsCoinsPerHour, } from './pest-rate-types.js'; const DEFAULT_INTERVAL_SECONDS = 3600; @@ -251,6 +253,44 @@ export class PestFarmingRateCalculator { return bestId; } + getPetsCoinsPerHour(pets: FarmingPet[], phase: PestFarmingPhase): PetsCoinsPerHour[] { + const petRates = pets.map((pet) => { + const petId = pet.pet.uuid; + if (!petId) return { pet, coinsPerHour: 0 }; + + const phaseLoadouts = { + ...this.player.phaseLoadouts, + [phase]: { + ...this.player.phaseLoadouts[phase], + petId: petId, + }, + }; + + // Calculate rates using a new calculator, skipping pet sort to avoid recursion + const calculator = new PestFarmingRateCalculator({ + player: createPestFarmingPlayer({ + ...this.player.options, + phaseLoadouts, + }), + options: this.options, + priceBook: this.priceBook, + }); + const result = calculator.calculate(); + const coinsPerHour = result.valuation.coinsPerHour; + + return { pet, coinsPerHour }; + }); + + // Sort petRates by coinsPerHour descending + return petRates.sort((a, b) => b.coinsPerHour - a.coinsPerHour); + } + + getBestPhasePetId(phase: PestFarmingPhase): string | undefined { + const phasePlayer = this.player.getPhasePlayer(phase); + const petRates = this.getPetsCoinsPerHour(phasePlayer.pets, phase); + return petRates[0]?.pet.pet.uuid ?? undefined; + } + private calculateSpawnArmorSetRate(armorSetId: string): number { const player = this.player.clone(); player.setPhaseArmorSet(PestFarmingPhase.Spawn, armorSetId); diff --git a/packages/farming-weight/src/pests/pest-rate-types.ts b/packages/farming-weight/src/pests/pest-rate-types.ts index c8458778..79653425 100644 --- a/packages/farming-weight/src/pests/pest-rate-types.ts +++ b/packages/farming-weight/src/pests/pest-rate-types.ts @@ -1,6 +1,7 @@ import type { Crop } from '../constants/crops.js'; import type { Pest } from '../constants/pests.js'; import type { FortuneUpgrade } from '../constants/upgrades.js'; +import type { FarmingPet } from '../fortune/farmingpet.js'; import type { PestFarmingPhase, PestFarmingPlayer } from '../player/pestfarmingplayer.js'; import type { DetailedDropsFromEffectsDelta, UpgradeRateImpact } from '../player/player.js'; import type { DetailedDropsFromEffectsResult } from '../util/ratecalc-effects.js'; @@ -234,3 +235,8 @@ export interface PestFarmingUpgradeRateImpact upgradeKey: string; valuationDelta: PestRateValuationDelta; } + +export interface PetsCoinsPerHour { + pet: FarmingPet; + coinsPerHour: number; +} diff --git a/packages/farming-weight/src/player/pestfarmingplayer.ts b/packages/farming-weight/src/player/pestfarmingplayer.ts index 44c22b89..50427f21 100644 --- a/packages/farming-weight/src/player/pestfarmingplayer.ts +++ b/packages/farming-weight/src/player/pestfarmingplayer.ts @@ -1,5 +1,4 @@ import { CROP_INFO, Crop } from '../constants/crops.js'; -import { FarmingPets } from '../constants/pets.js'; import { CROP_FARMING_STATS, PEST_FARMING_STATS, Stat, type StatBreakdown, VACUUM_STATS } from '../constants/stats.js'; import type { EffectSummary, @@ -486,20 +485,9 @@ export class PestFarmingPlayer { return result; } - private pickBestPetId(phase: PestFarmingPhase): string | undefined { + private pickBestPetId(_phase: PestFarmingPhase): string | undefined { const selectedUuid = this.options.selectedPet?.pet.uuid ?? undefined; - const defaultUuid = - selectedUuid ?? this.inventory.selectedPet?.pet.uuid ?? this.inventory.pets[0]?.pet.uuid ?? undefined; - switch (phase) { - case PestFarmingPhase.Spawn: - return ( - this.inventory.pets.find((pet) => pet.type === FarmingPets.Mosquito)?.pet.uuid ?? - this.inventory.pets.find((pet) => pet.type === FarmingPets.Slug)?.pet.uuid ?? - defaultUuid - ); - default: - return defaultUuid; - } + return selectedUuid ?? this.inventory.selectedPet?.pet.uuid ?? this.inventory.pets[0]?.pet.uuid ?? undefined; } private findArmor(slot: GearSlot, uuid: string): FarmingArmor | undefined { diff --git a/src/lib/stores/ratesData.ts b/src/lib/stores/ratesData.ts index a08378cb..d526cb53 100644 --- a/src/lib/stores/ratesData.ts +++ b/src/lib/stores/ratesData.ts @@ -20,7 +20,7 @@ export type PestFarmingTimeOfDay = 'day' | 'night'; export interface PestFarmingData { selectedCrop?: string; - phaseLoadouts: Partial>; + phaseLoadouts: Partial>; sprayedPlot: boolean; pesthunterAccessoryEnabled: boolean; timeOfDay: PestFarmingTimeOfDay; diff --git a/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/+page.svelte b/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/+page.svelte index 28bab635..9c156df0 100644 --- a/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/+page.svelte +++ b/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/+page.svelte @@ -252,26 +252,25 @@ onValueChange={(value) => value && pest.selectPhasePet(pest.activePhase, value)} > - {#each pest.pets - .filter((pet) => !!pet.pet.uuid) - .sort((a, b) => pest.getPetRateImpact(b, pest.activePhase) - pest.getPetRateImpact(a, pest.activePhase)) as pet, i (pet.pet.uuid ?? i)} - {@const petRateDelta = pest.getPetRateImpact(pet, pest.activePhase)} - + {#each pest + .getPhasePets(pest.activePhase) + .filter((petData) => !!petData.pet.pet.uuid) as petData, i (petData.pet.pet.uuid ?? i)} +
- - {#if petRateDelta !== 0} + + {#if petData.coinsPerHour !== 0} 0 ? 'dark:text-completed' : 'text-muted-foreground'} ml-auto text-xs whitespace-nowrap tabular-nums" > - {petRateDelta > 0 ? '+' : ''}{formatRate( - petRateDelta + {petData.coinsPerHour > 0 ? '+' : ''}{formatRate( + petData.coinsPerHour )} {/if} diff --git a/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/pest-farming-context.svelte.ts b/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/pest-farming-context.svelte.ts index 67d125a3..57e77cef 100644 --- a/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/pest-farming-context.svelte.ts +++ b/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/pest-farming-context.svelte.ts @@ -53,6 +53,7 @@ import { type PestPhaseLoadout, type PestRateItemPrice, type PestRatePriceBook, + type PetsCoinsPerHour, type StatBreakdown, type TemporaryFarmingFortune, type UpgradeTreeNode, @@ -449,20 +450,22 @@ export class PestFarmingPageContext { $effect(() => this.#syncExternalState()); $effect(() => this.#syncSelectedCrop()); $effect(() => this.#syncVacuumSelection()); - $effect(() => this.#syncDefaultSpawnArmorSelection()); + $effect(() => this.#syncDefaultPhaseLoadouts()); onMount(() => this.#restoreSavedCrop()); } - refreshPestPlayer() { + refreshPestPlayer(skip_default = false) { let player = createPestFarmingPlayer(this.options); - const phaseLoadouts = this.#getRateSelectedDefaultPhaseLoadouts(player); - if (phaseLoadouts) { - this.options = { - ...this.options, - phaseLoadouts, - } as PestFarmingPlayerOptions; - player = createPestFarmingPlayer(this.options); + if (!skip_default) { + const phaseLoadouts = this.#getRateSelectedDefaultPhaseLoadouts(player); + if (phaseLoadouts) { + this.options = { + ...this.options, + phaseLoadouts, + } as PestFarmingPlayerOptions; + player = createPestFarmingPlayer(this.options); + } } this.pestPlayer = player; this.#syncSessionSelectionsFromPestPlayer(); @@ -484,7 +487,8 @@ export class PestFarmingPageContext { [PestFarmingPhase.Farm, PestFarmingPhase.Spawn, PestFarmingPhase.Kill] .map((phase) => { const armorSetId = loadouts[phase]?.armorSetId; - return armorSetId ? [phase, { armorSetId }] : undefined; + const petId = loadouts[phase]?.petId; + return armorSetId || petId ? [phase, { armorSetId, petId }] : undefined; }) .filter((entry): entry is [PestFarmingPhase, PestPhaseLoadout] => entry !== undefined) ); @@ -494,9 +498,18 @@ export class PestFarmingPageContext { loadouts: Record ): PestFarmingData['phaseLoadouts'] { return { - [PestFarmingPhase.Farm]: { armorSetId: loadouts[PestFarmingPhase.Farm].armorSetId }, - [PestFarmingPhase.Spawn]: { armorSetId: loadouts[PestFarmingPhase.Spawn].armorSetId }, - [PestFarmingPhase.Kill]: { armorSetId: loadouts[PestFarmingPhase.Kill].armorSetId }, + [PestFarmingPhase.Farm]: { + armorSetId: loadouts[PestFarmingPhase.Farm].armorSetId, + petId: loadouts[PestFarmingPhase.Farm].petId, + }, + [PestFarmingPhase.Spawn]: { + armorSetId: loadouts[PestFarmingPhase.Spawn].armorSetId, + petId: loadouts[PestFarmingPhase.Spawn].petId, + }, + [PestFarmingPhase.Kill]: { + armorSetId: loadouts[PestFarmingPhase.Kill].armorSetId, + petId: loadouts[PestFarmingPhase.Kill].petId, + }, }; } @@ -519,10 +532,8 @@ export class PestFarmingPageContext { this.selectedVacuumId = this.pestPlayer.selectedVacuum?.item.uuid ?? this.selectedVacuumId; } - #syncDefaultSpawnArmorSelection(): void { + #syncDefaultPhaseLoadouts(): void { void this.pestRatePriceBook.version; - if (this.rates.pestFarming.phaseLoadouts[PestFarmingPhase.Spawn]?.armorSetId) return; - const phaseLoadouts = this.#getRateSelectedDefaultPhaseLoadouts(this.pestPlayer); if (!phaseLoadouts) return; @@ -530,23 +541,36 @@ export class PestFarmingPageContext { ...this.options, phaseLoadouts, } as PestFarmingPlayerOptions; - untrack(() => this.refreshPestPlayer()); + untrack(() => this.refreshPestPlayer(true)); } #getRateSelectedDefaultPhaseLoadouts( player: PestFarmingPlayer ): Record | undefined { const candidates = this.#getDefaultSpawnArmorCandidateIds(player); - if (!candidates) return; - - const bestId = this.#createRateCalculator(player).getBestSpawnPhaseArmorSetId(candidates); - if (!bestId || player.phaseLoadouts[PestFarmingPhase.Spawn]?.armorSetId === bestId) return; - + const bestId = candidates + ? this.#createRateCalculator(player).getBestSpawnPhaseArmorSetId(candidates) + : undefined; return { ...player.phaseLoadouts, + [PestFarmingPhase.Farm]: { + ...player.phaseLoadouts[PestFarmingPhase.Farm], + ...(this.#getDefaultPhasePetId(player, PestFarmingPhase.Farm) !== undefined && { + petId: this.#getDefaultPhasePetId(player, PestFarmingPhase.Farm), + }), + }, [PestFarmingPhase.Spawn]: { ...player.phaseLoadouts[PestFarmingPhase.Spawn], - armorSetId: bestId, + ...(candidates !== undefined && bestId === undefined && { armorSetId: bestId }), + ...(this.#getDefaultPhasePetId(player, PestFarmingPhase.Spawn) !== undefined && { + petId: this.#getDefaultPhasePetId(player, PestFarmingPhase.Spawn), + }), + }, + [PestFarmingPhase.Kill]: { + ...player.phaseLoadouts[PestFarmingPhase.Kill], + ...(this.#getDefaultPhasePetId(player, PestFarmingPhase.Kill) !== undefined && { + petId: this.#getDefaultPhasePetId(player, PestFarmingPhase.Kill), + }), }, }; } @@ -563,6 +587,11 @@ export class PestFarmingPageContext { return [mainId, spawnId]; } + #getDefaultPhasePetId(player: PestFarmingPlayer, phase: PestFarmingPhase): string | undefined { + if (this.rates.pestFarming.phaseLoadouts[phase]?.petId) return undefined; + return this.#createRateCalculator(player).getBestPhasePetId(phase); + } + trackPestVersion(): number { return this.pestVersion; } @@ -673,6 +702,10 @@ export class PestFarmingPageContext { return breakdown; } + getPhasePets(phase: PestFarmingPhase): PetsCoinsPerHour[] { + return this.#createRateCalculator(this.pestPlayer).getPetsCoinsPerHour(this.pets, phase); + } + getPetRateImpact(pet: FarmingPet, phase: PestFarmingPhase): number { const uuid = pet.pet.uuid; if (!uuid) return 0; @@ -846,6 +879,7 @@ export class PestFarmingPageContext { }; this.phaseLoadouts = phaseLoadouts; this.options = { ...this.options, phaseLoadouts } as PestFarmingPlayerOptions; + this.#updatePestFarmingData({ phaseLoadouts: this.#getPersistablePhaseLoadouts(phaseLoadouts) }); this.pestVersion++; trackAnalytics('pest_farming.phase_pet_selected', { phase }); } From 543c5ad2a0499cd3acb4a04ee2fdc8ab707fd827 Mon Sep 17 00:00:00 2001 From: Brett Tasker Date: Wed, 1 Jul 2026 22:18:33 +1200 Subject: [PATCH 5/5] Fix typing for PhaseLoadout in farming and rates --- packages/farming-weight/src/player/pestfarmingplayer.ts | 7 +++++-- src/lib/stores/ratesData.ts | 6 ++++-- .../pest-farming/pest-farming-context.svelte.ts | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/farming-weight/src/player/pestfarmingplayer.ts b/packages/farming-weight/src/player/pestfarmingplayer.ts index 50427f21..08487242 100644 --- a/packages/farming-weight/src/player/pestfarmingplayer.ts +++ b/packages/farming-weight/src/player/pestfarmingplayer.ts @@ -57,7 +57,7 @@ export interface PestArmorSetLoadout { export interface PestPhaseLoadout { armorSetId: string; - petId?: string; + petId: string | undefined; } export const PEST_MAIN_ARMOR_SET_ID = 'main'; @@ -674,7 +674,10 @@ export class PestFarmingPlayer { const armorSetIds = itemUuid ? this.getArmorSetIdsForUuid(itemUuid) : []; if (armorSetIds.length > 0) { for (const phaseKey of PEST_FARMING_PHASES) { - if (armorSetIds.includes(this.phaseLoadouts[phaseKey].armorSetId)) { + if ( + this.phaseLoadouts[phaseKey].armorSetId && + armorSetIds.includes(this.phaseLoadouts[phaseKey].armorSetId) + ) { this.phases[phaseKey].applyUpgrade(upgrade); } } diff --git a/src/lib/stores/ratesData.ts b/src/lib/stores/ratesData.ts index d526cb53..0e78a5ab 100644 --- a/src/lib/stores/ratesData.ts +++ b/src/lib/stores/ratesData.ts @@ -6,6 +6,7 @@ import { Pest, type PestAttractionSettings, PestFarmingPhase, + type PestPhaseLoadout, ZorroMode, type FarmingTool, type PestCycleSettings, @@ -20,7 +21,7 @@ export type PestFarmingTimeOfDay = 'day' | 'night'; export interface PestFarmingData { selectedCrop?: string; - phaseLoadouts: Partial>; + phaseLoadouts: Partial>; sprayedPlot: boolean; pesthunterAccessoryEnabled: boolean; timeOfDay: PestFarmingTimeOfDay; @@ -141,8 +142,9 @@ function normalizePestFarmingData(data?: Partial): PestFarmingD if (!isLegacyDefaultPhaseLoadouts(data?.phaseLoadouts)) { for (const phase of [PestFarmingPhase.Farm, PestFarmingPhase.Spawn, PestFarmingPhase.Kill]) { const armorSetId = data?.phaseLoadouts?.[phase]?.armorSetId; + const petId = data?.phaseLoadouts?.[phase]?.petId; if (armorSetId && armorSetIds.has(armorSetId)) { - phaseLoadouts[phase] = { armorSetId }; + phaseLoadouts[phase] = { armorSetId, petId }; } } } diff --git a/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/pest-farming-context.svelte.ts b/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/pest-farming-context.svelte.ts index 57e77cef..ba73d88a 100644 --- a/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/pest-farming-context.svelte.ts +++ b/src/routes/(main)/@[id=id]/[[profile]]/pest-farming/pest-farming-context.svelte.ts @@ -488,7 +488,7 @@ export class PestFarmingPageContext { .map((phase) => { const armorSetId = loadouts[phase]?.armorSetId; const petId = loadouts[phase]?.petId; - return armorSetId || petId ? [phase, { armorSetId, petId }] : undefined; + return armorSetId ? [phase, { armorSetId, petId }] : undefined; }) .filter((entry): entry is [PestFarmingPhase, PestPhaseLoadout] => entry !== undefined) ); @@ -561,7 +561,7 @@ export class PestFarmingPageContext { }, [PestFarmingPhase.Spawn]: { ...player.phaseLoadouts[PestFarmingPhase.Spawn], - ...(candidates !== undefined && bestId === undefined && { armorSetId: bestId }), + ...(bestId !== undefined && { armorSetId: bestId }), ...(this.#getDefaultPhasePetId(player, PestFarmingPhase.Spawn) !== undefined && { petId: this.#getDefaultPhasePetId(player, PestFarmingPhase.Spawn), }),