diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-03-26 23:04:19 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-03-26 23:04:19 (EDT) |
commit | 0710b7ace924b691e95eca41924be4acae7a015e (patch) | |
tree | 619ac1c90f1f30a39d2b26f30f92c6f766c725b3 | |
parent | b5bc4b9fdfd72a3f35b78c138836b963b0883d06 (diff) | |
download | dodge-balls-0710b7ace924b691e95eca41924be4acae7a015e.zip dodge-balls-0710b7ace924b691e95eca41924be4acae7a015e.tar.gz dodge-balls-0710b7ace924b691e95eca41924be4acae7a015e.tar.bz2 |
map: Fix speed type conversions
-rw-r--r-- | src/map.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -404,6 +404,8 @@ _db_tmx_object_property_start(void *pv, const char *name, const char **attr) struct db_map *map; char *p_name; char *p_type; + int s_i; + float s_f; char *dir; db_dbg(" <%s> (property)", name); @@ -421,10 +423,12 @@ _db_tmx_object_property_start(void *pv, const char *name, const char **attr) db_xml_get_string_attr(p, attr, "type", &p_type, 1); if (strcmp(p_type, "int") == 0) { db_xml_get_int_attr(p, attr, "value", - (int *) &map->obj_s, 1); + &s_i, 1); + map->obj_s = s_i; } else if (strcmp(p_type, "float") == 0) { db_xml_get_float_attr(p, attr, "value", - (float *) &map->obj_s, 1); + &s_f, 1); + map->obj_s = s_f; } else { db_err("Object speed must be an integer or " "float"); |