From ea035ac154bf02c080f434d261d5c209d010e3e8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 24 Dec 2014 16:21:01 +0100 Subject: [PATCH] convert float values in at_object to integer where it makes sense. this feature is only used for the embassy_muschel turn, and I am tempted to kill it entirely. --- src/attributes/object.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/attributes/object.c b/src/attributes/object.c index c0d0e0800..ae06d6454 100644 --- a/src/attributes/object.c +++ b/src/attributes/object.c @@ -112,7 +112,13 @@ static int object_read(attrib * a, void *owner, struct storage *store) break; case TREAL: READ_FLT(store, &flt); - data->data.real = flt; + if ((int)flt == flt) { + data->type = TINTEGER; + data->data.i = (int)flt; + } + else { + data->data.real = flt; + } break; case TSTRING: READ_STR(store, name, sizeof(name));