Skip to content

Commit

Permalink
Only send one Harvester if multiple ones are tasked to build. Closes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
bananu7 committed Oct 8, 2022
1 parent 1b4fb07 commit ddd5aa4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/MatchList.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit ddd5aa4

Please sign in to comment.