From 75f2e4c3b0ed7b901506f7afcf480ffc2f4f1afe Mon Sep 17 00:00:00 2001 From: kdx Date: Tue, 28 Mar 2023 04:33:10 +0000 Subject: if object has no type try name --- src/game.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game.c b/src/game.c index 5166d99..ea98bec 100644 --- a/src/game.c +++ b/src/game.c @@ -63,7 +63,9 @@ game_restart_scene(Game *this) const __auto_type objects = map_objects(&size); for (__auto_type i = 0u; i < size; i++) { const __auto_type object = &objects[i]; - const __auto_type type = entity_type(object->type); + const __auto_type type = (object->type && object->type[0]) + ? entity_type(object->type) + : entity_type(object->name); if (type == 0) continue; const __auto_type x = object->x + object->width / 2; -- cgit v1.2.3