Skip to content

Commit

Permalink
handle missing cases for switch fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Nov 12, 2024
1 parent c0ce028 commit e468b54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/types/item/spawnLocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,9 @@ function getMapgenValueDistribution(val: raw.MapgenValue): Map<string, number> {
"switch" in val &&
typeof val.switch === "object" &&
"fallback" in val.switch &&
val.switch.fallback
val.switch.fallback &&
val.switch.fallback in val.cases &&
val.cases[val.switch.fallback]
)
return new Map([[val.cases[val.switch.fallback], 1]]);
if ("distribution" in val) {
Expand Down

0 comments on commit e468b54

Please sign in to comment.