Skip to content

Commit 57ff3f7

Browse files
committed
fix: Don't spawn ships twice at game start
1 parent d6daf2e commit 57ff3f7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/game-logic/game-logic.service.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ export class GameLogicService {
5656
empire.homeSystem = homeSystem._id;
5757
}
5858

59-
const fleets = await this.fleetService.generateFleets(empires);
60-
await this.shipService.createShips(fleets);
61-
62-
const rogueFleets = await this.fleetService.generateRogueFleets(game, systems.filter(s => !homeSystems.has(s._id.toString())));
63-
await this.shipService.createShips(rogueFleets);
59+
// Create fleets (ships are spawned automatically due to the fleet created handler
60+
await this.fleetService.generateFleets(empires);
61+
await this.fleetService.generateRogueFleets(game, systems.filter(s => !homeSystems.has(s._id.toString())));
6462

6563
await this.empireService.saveAll(empires);
6664
await this.systemService.saveAll(systems);

0 commit comments

Comments
 (0)