fix: _getBattlefieldCards reads battlefieldCards instead of battlefield

Was reading gameState.battlefield (doesn't exist) causing AI to
receive empty board state. Now reads gameState.battlefieldCards
and matches by ownerIndex.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rgriffithandClaude Opus 4.6 committed 2026-04-04 17:00:39 -04:00
1 parent ef739e1f49
commit bbb7f7a966
1 file changed
+3 -3
+3 -3
View File
@@ -505,9 +505,9 @@ class GameStateBridge {
* Get all battlefield cards for a player.
*/
_getBattlefieldCards(player, gameState) {
if (!gameState || !gameState.battlefield) return [];
return (gameState.battlefield || []).filter(
c => c.controller === player.id || c.owner === player.id
if (!gameState || !gameState.battlefieldCards) return [];
return gameState.battlefieldCards.filter(
c => c.ownerIndex === player.id
);
}