From 0710b7ace924b691e95eca41924be4acae7a015e Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 26 Mar 2021 23:04:19 -0400 Subject: map: Fix speed type conversions --- diff --git a/src/map.c b/src/map.c index fdb2456..7eb4ddb 100644 --- a/src/map.c +++ b/src/map.c @@ -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"); -- cgit v0.9.1