diff options
author | kdx <kdx.42@42l.fr> | 2023-03-28 04:33:10 +0000 |
---|---|---|
committer | kdx <kdx.42@42l.fr> | 2023-03-28 04:39:26 +0000 |
commit | 75f2e4c3b0ed7b901506f7afcf480ffc2f4f1afe (patch) | |
tree | 802ba36795619bb7c4ef037de0f3124badccc697 | |
parent | e51c1cf50bcaeca47c20d5e35df3df713d892a57 (diff) | |
download | 006-75f2e4c3b0ed7b901506f7afcf480ffc2f4f1afe.tar.gz |
if object has no type try name
-rw-r--r-- | src/game.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |