Skip to content

Commit 9e5b2b2

Browse files
committed
[feat] Add lobby screen for singleplayer.
1 parent f8e356a commit 9e5b2b2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/scenarios/netGame.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default async function runScenario(game: Game) {
4141
}
4242
const gameInstance = game.netGameInstance;
4343
const parent = game.viewport;
44-
const world = game.world as NetGameWorld;
44+
const world = game.world;
4545
const { worldWidth } = game.viewport;
4646
const wormInstances = new Map<string, Worm>();
4747

@@ -323,10 +323,12 @@ export default async function runScenario(game: Game) {
323323
.subscribe(([roundState, worm]) => {
324324
if (
325325
worm?.team.playerUserId === gameInstance.myUserId &&
326-
roundState === RoundState.Preround
326+
roundState === RoundState.Preround &&
327+
world instanceof NetGameWorld
327328
) {
328329
world.setBroadcasting(true);
329-
} else if (roundState === RoundState.Finished) {
330+
} else if (roundState === RoundState.Finished &&
331+
world instanceof NetGameWorld) {
330332
world.setBroadcasting(false);
331333
}
332334
log.info("Round state sub fired for", roundState, worm);

0 commit comments

Comments
 (0)