Skip to content

Commit

Permalink
Log exception in tick to player (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Casp-ian authored Jan 30, 2025
1 parent 235eefd commit 6d56eb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/src/game/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { type DungeonBuilderOptions } from "../generation/builder.ts";
import { RNG, Deck } from "./random.ts";
import { Player } from "./player.ts";
import { WorldMap } from "./map.ts";
import { LogLevel } from "../core/logger.ts";

export enum GameState {
Setup,
Expand Down Expand Up @@ -262,6 +263,7 @@ export class World extends EventTarget {
try {
move = await player.tickTurn(circumstances, visualTick);
} catch (error) {
player.coordinator.logger(LogLevel.Error, "Exception in player tick");
console.error("Exception in player tick:", error);
player.lastMoveStatus = CoreMsg.MoveResult.Error;
continue;
Expand Down

0 comments on commit 6d56eb2

Please sign in to comment.