1
mirror of https://github.com/thepeacockproject/Peacock synced 2025-03-27 11:12:44 +01:00

Get sublocation using unlockables map

This commit is contained in:
AnthonyFuller 2023-08-04 12:10:10 +01:00
parent a910aa6cce
commit 2518215a06

@ -20,7 +20,6 @@ import type {
GameVersion,
MissionManifest,
RequestWithJwt,
Unlockable,
UserCentricContract,
} from "../types/types"
import { controller } from "../controller"
@ -28,6 +27,7 @@ import { generateUserCentric } from "../contracts/dataGen"
import { getUserData, writeUserData } from "../databaseHandler"
import { getVersionedConfig } from "../configSwizzleManager"
import type { Response } from "express"
import { getUnlockableById } from "../inventory"
export function withLookupDialog(
req: RequestWithJwt<{ contractId: string }>,
@ -61,11 +61,10 @@ export function withLookupDialog(
}
}
const sublocation = getVersionedConfig<readonly Unlockable[]>(
"allunlockables",
const sublocation = getUnlockableById(
contract.Metadata.Location,
req.gameVersion,
false,
).find((entry) => entry.Id === contract.Metadata.Location)
)
// Must toggle before generating the user centric contract.
const flag = toggleFavorite(