From 9f0ccd188c2f2925037b04a4ab9b3f8b010ea3c7 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 1 Mar 2025 16:07:50 -0700 Subject: make the carcadr level an _actual_ carcadr level --- src/engine/entities/FunctionApplication.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/engine/entities') diff --git a/src/engine/entities/FunctionApplication.ts b/src/engine/entities/FunctionApplication.ts index bd88bda..ac07f88 100644 --- a/src/engine/entities/FunctionApplication.ts +++ b/src/engine/entities/FunctionApplication.ts @@ -30,8 +30,9 @@ import { interpret, } from "../../interpreter"; -const APPLICATION_RESULTS: Record Entity> = { +const APPLICATION_RESULTS: Record null | Entity> = { _KEY: (gridPosition: Coord2D) => new Key(gridPosition), + _EMPTY: (_gridPosition: Coord2D) => null, }; export class FunctionApplication extends Entity { @@ -177,7 +178,8 @@ export class FunctionApplication extends Entity { const { name } = data; const entityFactory = APPLICATION_RESULTS[name]; if (entityFactory) { - game.addEntity(entityFactory(nextPosition)); + const entity = entityFactory(nextPosition) + entity && game.addEntity(entity); } } -- cgit v1.2.3-70-g09d2