Skip to content

Commit 7080a77

Browse files
fix: loadouts being empty on brand-new profiles (#661)
In 11b4373 we did some refactoring, but because of how it ended up, this code path never gets hit when using loadout profiles. Fixes an issue reported on Discord where new profiles would start with empty loadouts.
2 parents 0d802dc + 0245747 commit 7080a77

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

components/loadouts.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,14 @@ export class Loadouts {
201201
userProfile.Extensions.defaultloadout?.[sublocation?.Id] ??
202202
defaultLoadout
203203
} else {
204-
let dl = loadouts.getLoadoutFor(gameVersion)
204+
let gameVersionedLoadout = loadouts.getLoadoutFor(gameVersion)
205205

206-
if (!dl) {
207-
dl = loadouts.createDefault(gameVersion)
206+
if (!gameVersionedLoadout) {
207+
gameVersionedLoadout = loadouts.createDefault(gameVersion)
208208
}
209209

210-
loadout = dl.data[sublocation?.Id] ?? {}
210+
loadout =
211+
gameVersionedLoadout.data[sublocation?.Id] ?? defaultLoadout
211212
}
212213

213214
// SILLY HACK FOR OLD (< 8.6.0) SAVES: For LOCATION_NEWZEALAND, if the saved suit is TOKEN_OUTFIT_WET_SUIT, replace

0 commit comments

Comments
 (0)