fix terrain passing

This commit is contained in:
xeals 2023-04-27 11:48:40 +10:00
parent 4692ffa259
commit 01cf81f930
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C

View File

@ -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}`
);
}
}