diff options
author | kdx <kdx.42@42l.fr> | 2023-03-26 07:11:55 +0000 |
---|---|---|
committer | kdx <kdx.42@42l.fr> | 2023-03-26 07:11:55 +0000 |
commit | 83f5fc33df8ea2b8df661f921f157080d472a0ae (patch) | |
tree | 2862b2afa978a700f6cfa39601c6d87a9bf72260 /src/entity.c | |
parent | 60b9ce29c42ac9fff81c677ab0426415046259b3 (diff) | |
download | hyperultra-83f5fc33df8ea2b8df661f921f157080d472a0ae.tar.gz |
simplify entityimpl a bit
Diffstat (limited to 'src/entity.c')
-rw-r--r-- | src/entity.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/entity.c b/src/entity.c index 8fdaa9e..00e6719 100644 --- a/src/entity.c +++ b/src/entity.c @@ -20,7 +20,7 @@ unsigned int entity_type(const char *type) { for (unsigned int i = 0; i < num_entitytags; i++) - if (strcmp(type, entitytags[i]) == 0) + if (strcmp(type, entitytags[i].name) == 0) return i + 1; fprintf(stderr, "unknown type '%s'\n", type); return 0; @@ -100,5 +100,5 @@ entity_move(Entity *this, Game *g) Entity * entity_init(Entity *this, unsigned int type, int x, int y) { - return entityinits[type - 1](this, x, y); + return entitytags[type - 1].init(this, x, y); } |