From f9d8841055a389ee2051b6690ce21fff2b9d1ddd Mon Sep 17 00:00:00 2001 From: Grimiku Date: Thu, 24 Jul 2025 17:32:25 +0200 Subject: [PATCH] [Portugal] Type-check fix --- src/maps/portugal/lisboa.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/maps/portugal/lisboa.ts b/src/maps/portugal/lisboa.ts index bb9d2dcb..cb831f8d 100644 --- a/src/maps/portugal/lisboa.ts +++ b/src/maps/portugal/lisboa.ts @@ -117,7 +117,10 @@ export class PortugalMoveValidator extends MoveValidator { .flatMap((connection) => { const otherEnd = grid.get( connection.connects.find((c) => !location.coordinates.equals(c))!, - ) as City; + ); + if (!(otherEnd instanceof City)) { + return []; + } if ( (isLisboa(otherEnd) || otherEnd.name() === "Madeira") && (location.name() === "Sagres" || location.name() === "Sines") && @@ -146,7 +149,10 @@ export class PortugalMoveValidator extends MoveValidator { .flatMap((connection) => { const otherEnd = grid.get( connection.connects.find((c) => !location.coordinates.equals(c))!, - ) as Land; + ); + if (!(otherEnd instanceof Land)) { + return []; + } if ( (isLisboa(location) || location.name() === "Madeira") && (otherEnd.name() === "Sagres" || otherEnd.name() === "Sines") &&