Skip to content

Commit 686a96c

Browse files
committed
Gyges: Add nonexistent validation message.
1 parent dea5e29 commit 686a96c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/games/gyges.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,12 @@ export class GygesGame extends GameBase {
840840
const cells = stub.split("-");
841841
const start = cells[0];
842842
const end = cells[cells.length - 1];
843+
// must be occupied
844+
if (!this.board.has(start)) {
845+
result.valid = false;
846+
result.message = i18next.t("apgames:validation._general.NONEXISTENT", {where: start});
847+
return result;
848+
}
843849
// moving piece must be closest to player
844850
const firstRow = this.getPlayableRow();
845851
if (!start.endsWith(firstRow)) {

0 commit comments

Comments
 (0)