Skip to content

Commit 46122bc

Browse files
committed
extra guard against values firing on stopped game
1 parent 85570ae commit 46122bc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

engine/value/value.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
JsonObject,
66
ValueRegistry,
77
} from "@dreamlab/engine";
8-
import { ObjectAdapter, ValueTypeAdapter } from "@dreamlab/engine";
8+
import { GameStatus, ObjectAdapter, ValueTypeAdapter } from "@dreamlab/engine";
99
import * as internal from "@dreamlab/engine/internal";
1010
import type { ReadonlyDeep } from "@dreamlab/vendor/type-fest.ts";
1111
import { JsonValue } from "./data.ts";
@@ -197,6 +197,7 @@ export class Value<T = unknown> {
197197
incomingClock: number,
198198
incomingSource: ConnectionId,
199199
): void {
200+
if (this.#registry.game.status !== GameStatus.Running) return;
200201
if (this.#destroyed) return;
201202

202203
if (incomingClock < this.clock) return;

0 commit comments

Comments
 (0)