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

Fix HITMAN 2 stuck at loading main menu ()

* 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

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

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