1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-11-22 22:12:45 +01:00

Fix HITMAN 2 stuck at loading main menu (#91)

* Fix H2 hub stuck at loading
This commit is contained in:
moonysolari 2023-01-26 10:15:27 -05:00 committed by GitHub
parent ab86ff6997
commit 1a15f4cf71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -1201,11 +1201,20 @@ export function contractIdToHitObject(
}
const subLocation = getSubLocationFromContract(contract, gameVersion)
let parentLocId = subLocation?.Properties?.ParentLocation
if (parentLocId === "LOCATION_PARENT_ICA_SHIP_FACILITY") {
parentLocId = "LOCATION_PARENT_ICA_FACILITY"
}
if (parentLocId === "LOCATION_PARENT_COASTALTOWN_EBOLA") {
parentLocId = "LOCATION_PARENT_COASTALTOWN"
}
const parentLocation = getVersionedConfig<PeacockLocationsData>(
"LocationsData",
gameVersion,
false,
).parents[subLocation?.Properties?.ParentLocation]
).parents[parentLocId]
// failed to find the location, must be from a newer game
if (!subLocation && (gameVersion === "h1" || gameVersion === "h2")) {
@ -1224,7 +1233,7 @@ export function contractIdToHitObject(
}
const challenges = controller.challengeService.getGroupedChallengeLists({
type: ChallengeFilterType.ParentLocation,
locationParentId: parentLocation.Id,
locationParentId: parentLocation?.Id,
})
const challengeCompletion =
controller.challengeService.countTotalNCompletedChallenges(

View File

@ -232,7 +232,7 @@ menuDataRouter.get("/Hub", (req: RequestWithJwt, res) => {
req.gameVersion,
)
career[parent].Children.push({
career[parent]?.Children.push({
IsLocked: location.Properties.IsLocked,
Name: location.DisplayNameLocKey,
Image: location.Properties.Icon,