Spaces:
Sleeping
Sleeping
agent should do nothing while in lobby
Browse files- convex/aiTown/agent.ts +3 -0
convex/aiTown/agent.ts
CHANGED
|
@@ -50,6 +50,9 @@ export class Agent {
|
|
| 50 |
}
|
| 51 |
|
| 52 |
tick(game: Game, now: number) {
|
|
|
|
|
|
|
|
|
|
| 53 |
const player = game.world.players.get(this.playerId);
|
| 54 |
if (!player) {
|
| 55 |
throw new Error(`Invalid player ID ${this.playerId}`);
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
tick(game: Game, now: number) {
|
| 53 |
+
if game.world.gameCycle.cycleState==="LobbyState"{
|
| 54 |
+
return
|
| 55 |
+
}
|
| 56 |
const player = game.world.players.get(this.playerId);
|
| 57 |
if (!player) {
|
| 58 |
throw new Error(`Invalid player ID ${this.playerId}`);
|