fix terrain passing
This commit is contained in:
parent
4692ffa259
commit
01cf81f930
8
calc.js
8
calc.js
@ -121,7 +121,7 @@ function* iterate(arr) {
|
||||
function unwrapToken(type, token) {
|
||||
assert(
|
||||
token.tokenType.name == type,
|
||||
`expected token ${type}, got ${token.tokenType.name}`,
|
||||
`expected token ${type}, got ${token.tokenType.name}`
|
||||
);
|
||||
return token.image;
|
||||
}
|
||||
@ -237,13 +237,11 @@ function parseAndCalculate(line) {
|
||||
field.weather = next.image;
|
||||
break;
|
||||
case "Terrain":
|
||||
field.terrain = next.image;
|
||||
field.terrain = next.image.replace(" Terrain", "");
|
||||
break;
|
||||
default:
|
||||
throw Error(
|
||||
"Unhandled terrain %s: %s",
|
||||
next.tokenType.name,
|
||||
next.image
|
||||
`Unhandled field condition ${next.tokenType.name}: ${next.image}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user