From ddd5aa4bc9a6b8dce1a58312d4fabd2dacf0a978 Mon Sep 17 00:00:00 2001 From: bananu7 Date: Sat, 8 Oct 2022 18:18:32 +0200 Subject: [PATCH] Only send one Harvester if multiple ones are tasked to build. Closes #12 --- packages/client/src/App.tsx | 4 +++- packages/client/src/components/MatchList.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/client/src/App.tsx b/packages/client/src/App.tsx index 648bb7d..6c89877 100644 --- a/packages/client/src/App.tsx +++ b/packages/client/src/App.tsx @@ -82,7 +82,9 @@ function App() { } else if (selectedAction.action === 'Attack') { multiplayer.attackMoveCommand(Array.from(selectedUnits), p); } else if (selectedAction.action === 'Build') { - multiplayer.buildCommand(Array.from(selectedUnits), selectedAction.building, p); + // Only send one harvester to build + // TODO send the closest one + multiplayer.buildCommand([selectedUnits.keys().next().value], selectedAction.building, p); } break; case 2: diff --git a/packages/client/src/components/MatchList.tsx b/packages/client/src/components/MatchList.tsx index 2e69dd0..0cc72e0 100644 --- a/packages/client/src/components/MatchList.tsx +++ b/packages/client/src/components/MatchList.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react' import { MatchInfo } from 'server/types' -import { HTTP_API_URL } from './config' +import { HTTP_API_URL } from '../config' type Props = { joinMatch: (matchId: string) => void;