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
2 changes: 2 additions & 0 deletions src/engine/core/GameCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,14 @@ const COMMAND_EVENTS: Record<GameCommandType, string> = {
* @param command The game command to dispatch
*/
export function dispatchCommand(eventBus: EventBus, command: GameCommand): void {
console.log('[dispatchCommand] Dispatching command:', command.type, command.entityIds);
// Emit generic command event for logging/debugging
eventBus.emit('command:received', command);

// Build event payload based on command type
switch (command.type) {
case 'MOVE':
console.log('[dispatchCommand] Emitting command:move event');
eventBus.emit(COMMAND_EVENTS.MOVE, command);
break;

Expand Down
5 changes: 5 additions & 0 deletions src/engine/systems/movement/FormationMovement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ export class FormationMovement {
targetPosition: { x: number; y: number };
queue?: boolean;
}): void {
console.log('[FormationMovement] handleMoveCommand received:', {
entityIds: data.entityIds,
targetPosition: data.targetPosition,
queue: data.queue,
});
const { entityIds, targetPosition, queue } = data;

// Single unit always goes directly to target
Expand Down
Loading