refactor: fix command parsing

This commit is contained in:
2026-04-02 00:14:43 +08:00
parent a8ff79e4e5
commit ff9d9bd9a1
8 changed files with 111 additions and 122 deletions
+2 -2
View File
@@ -125,8 +125,8 @@ export function createTurnRule() {
const playCmd = received as Command;
if (playCmd.name !== 'play') continue;
const row = Number(playCmd.params[1]);
const col = Number(playCmd.params[2]);
const row = playCmd.params[1] as number;
const col = playCmd.params[2] as number;
if (isNaN(row) || isNaN(col) || row < 0 || row > 2 || col < 0 || col > 2) continue;
if (isCellOccupied(this, row, col)) continue;