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) { function unwrapToken(type, token) {
assert( assert(
token.tokenType.name == type, token.tokenType.name == type,
`expected token ${type}, got ${token.tokenType.name}`, `expected token ${type}, got ${token.tokenType.name}`
); );
return token.image; return token.image;
} }
@ -237,13 +237,11 @@ function parseAndCalculate(line) {
field.weather = next.image; field.weather = next.image;
break; break;
case "Terrain": case "Terrain":
field.terrain = next.image; field.terrain = next.image.replace(" Terrain", "");
break; break;
default: default:
throw Error( throw Error(
"Unhandled terrain %s: %s", `Unhandled field condition ${next.tokenType.name}: ${next.image}`
next.tokenType.name,
next.image
); );
} }
} }