thepeacockproject / Peacock

The Peacock Project is a HITMAN™ World of Assassination trilogy server replacement.
https://thepeacockproject.org
GNU Affero General Public License v3.0
387 stars 60 forks source link

hotfix: fix call to getUnlockableById in planning #299

Closed jorys-paulin closed 1 year ago

jorys-paulin commented 1 year ago

The code in components/menus/planning.ts on line 381 calls the ` function with the wrong arguments, sendinggameVersionthenidwhere it should beidthengameVersion`:

const loadoutUnlockable = getUnlockableById(
    req.gameVersion,
    req.gameVersion === "h1"
        ? sublocation?.Properties?.NormalLoadoutUnlock[
              contractData.Metadata.Difficulty ?? "normal"
          ]
        : sublocation?.Properties?.NormalLoadoutUnlock,
)

This causes planning for Miami and Hokkaido, which use that code, to break. The server just errors out and the game is stuck until it times out.

This pull request fixes that inversion.

Fixes #298.