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:
parent
ab86ff6997
commit
1a15f4cf71
@ -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(
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user