From deb481d2cff5e458e4bfefb85919b21cec334c7e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 28 Jan 2026 12:38:16 +0100 Subject: test-client: fix unload crash --- data/maps/lobby.yaml | 2 +- test-client/tiles.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/maps/lobby.yaml b/data/maps/lobby.yaml index 1c49ee63..564dcf43 100644 --- a/data/maps/lobby.yaml +++ b/data/maps/lobby.yaml @@ -41,7 +41,7 @@ tiles: # "7": table -i=plate:pizza:sliced-mushroom,sliced-cheese,tomato-juice # "8": table -i=plate:mushroom-soup "~": floor --chef-spawn - ".": floor --customer-spawn + ".": floor "'": grass "g": counter cutting-board "h": counter rolling-board diff --git a/test-client/tiles.ts b/test-client/tiles.ts index 150d654f..f4c3c5f4 100644 --- a/test-client/tiles.ts +++ b/test-client/tiles.ts @@ -217,15 +217,15 @@ function debug_label(ctx: CanvasRenderingContext2D, name: string) { // TODO performance export function draw_item_sprite(ctx: CanvasRenderingContext2D, name: ItemName) { const [base, cont] = name.split(":") - const c = ITEMS[base] - if (c) { - c(cont?.split(",") ?? [])(ctx) + if (ITEMS[base]) { + ITEMS[base](cont?.split(",") ?? [])(ctx) } else { circle(0.4, "#f0f")(ctx) debug_label(ctx, name) } } export function draw_tile_sprite(ctx: CanvasRenderingContext2D, name: TileName) { + if (!name) return const [kind, param] = name.split(":", 2) if (TILES[kind]) { TILES[kind](param)(ctx) -- cgit v1.3