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:
1 parent
ef739e1f49
commit
bbb7f7a966
1 file changed
+3
-3
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user