diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-28 12:38:16 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-28 12:38:16 +0100 |
| commit | deb481d2cff5e458e4bfefb85919b21cec334c7e (patch) | |
| tree | eecff11fc258e9dc9d6c966605da1246cfdb2d83 | |
| parent | 66af6842553f6526b97430963bfb55931184f4aa (diff) | |
| download | hurrycurry-deb481d2cff5e458e4bfefb85919b21cec334c7e.tar hurrycurry-deb481d2cff5e458e4bfefb85919b21cec334c7e.tar.bz2 hurrycurry-deb481d2cff5e458e4bfefb85919b21cec334c7e.tar.zst | |
test-client: fix unload crash
| -rw-r--r-- | data/maps/lobby.yaml | 2 | ||||
| -rw-r--r-- | 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) |