Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/games/linage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,14 @@ export class LinageGame extends GameBase {
return result;
}

try {
this.algebraic2coords(m);
} catch {
result.valid = false;
result.message = i18next.t("apgames:validation._general.INVALIDCELL", {cell: m});
return result;
}

if ( this.board.has(m) ) {
result.valid = false;
result.message = i18next.t("apgames:validation.linage.OCCUPIED");
Expand Down
15 changes: 13 additions & 2 deletions src/games/narrows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class NarrowsGame extends GameBase {
name: "Narrows",
uid: "narrows",
playercounts: [2],
version: "20260521",
dateAdded: "2026-05-27",
version: "20260604",
dateAdded: "2026-06-04",
// i18next.t("apgames:descriptions.narrows")
description: "apgames:descriptions.narrows",
notes: "apgames:notes.narrows",
Expand Down Expand Up @@ -244,6 +244,17 @@ export class NarrowsGame extends GameBase {
}

const moves = m.split('-');

try {
for (const cell of moves) {
this.graph.algebraic2coords(cell);
}
} catch {
result.valid = false;
result.message = i18next.t("apgames:validation._general.INVALID_MOVE", {move: m});
return result;
}

const allMoves = this.moves();

if (moves.length === 1) {
Expand Down
11 changes: 11 additions & 0 deletions src/games/pippinzip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,17 @@ export class PippinzipGame extends GameBase {
}

const moves = m.split(',');

try {
for (const cell of moves) {
PippinzipGame.algebraic2coords(cell, this.boardSize);
}
} catch {
result.valid = false;
result.message = i18next.t("apgames:validation._general.INVALID_MOVE", {move: m});
return result;
}

for (const cell of moves) {
if ( this.board.has(cell) ) {
result.valid = false;
Expand Down
6 changes: 4 additions & 2 deletions src/games/pollux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,12 @@ export class PolluxGame extends GameBase {
const allMoves = this.moves();

try {
for (const cell of moves) { this.graph.algebraic2coords(cell); }
for (const cell of moves) {
this.graph.algebraic2coords(cell);
}
} catch {
result.valid = false;
result.message = i18next.t("apgames:validation._general.INVALIDMOVE", {m});
result.message = i18next.t("apgames:validation._general.INVALID_MOVE", {move: m});
return result;
}

Expand Down
Loading