diff --git a/src/GameData.ts b/src/GameData.ts index 530392e..5bc3c17 100644 --- a/src/GameData.ts +++ b/src/GameData.ts @@ -99,7 +99,7 @@ export async function loadAvailableQuests(): Promise<{ [key: string]: { [key: st const questRankData = questsData.ranks[questRank]; for (const quest of questRankData) { - const id = quest.id; + const id = hash(JSON.stringify(quest)); const phases = [] as Array; if (Array.isArray(quest?.phases)) { @@ -171,3 +171,11 @@ export function removeAlreadyHiredAdventurers( } return adventurersForHire; } + +function hash(str: string): string { + let hash = 5381; + for (let i = 0; i < str.length; i++) { + hash = (hash * 33) ^ str.charCodeAt(i); + } + return (hash >>> 0).toString(16); +}