Claude/fix ai command error zrx zq#1194
Merged
Merged
Conversation
The AI systems (AITacticsManager, AIScoutingManager, AIMicroSystem) call this.game.issueAICommand() but the method was only defined in Game.ts (main thread), not in GameCore (base class). When running in a worker context, WorkerGame extends GameCore directly and lacked this method, causing "this.game.issueAICommand is not a function" errors. Added issueAICommand to GameCore so it's available in both: - Main thread (Game class - with multiplayer command recording override) - Worker (WorkerGame class - uses base implementation) https://claude.ai/code/session_01T24MdL2bd5Tyb6PxJnyFgZ
The override was bypassing Game.processCommand to skip authorization, but AI commands pass authorization anyway (AI controls AI-owned units). Game.processCommand already records commands in multiplayer mode. Now the base GameCore.issueAICommand handles all cases cleanly: - Calls this.processCommand() which polymorphically routes to the correct impl - Worker: Uses GameCore.processCommand directly (no network recording needed) - Main thread: Uses Game.processCommand (records for sync responses) https://claude.ai/code/session_01T24MdL2bd5Tyb6PxJnyFgZ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.