Skip to content

Commit

Permalink
Remove silent failure when computing landmark cost (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinddchen authored Nov 28, 2024
1 parent 513550a commit f16178e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/game/landmarks/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ export const cost = (G: MachikoroG, land: Landmark, player: number): number => {
case Version.MK2: {
// Machi Koro 2 landmark costs change based on the number of built landmarks
const built = countBuilt(G, player);
// TODO: loud error on out of bounds
const costIdx = Math.min(Math.max(built, 0), land.cost.length - 1); // avoid array out of bounds
return landCostArray[costIdx];
return landCostArray[built];
}
}
};
Expand Down

0 comments on commit f16178e

Please sign in to comment.