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.
This commit is contained in:
Enno Rehling 2014-12-24 16:21:01 +01:00
parent 67881dfff4
commit ea035ac154
1 changed files with 7 additions and 1 deletions

View File

@ -112,7 +112,13 @@ static int object_read(attrib * a, void *owner, struct storage *store)
break; break;
case TREAL: case TREAL:
READ_FLT(store, &flt); 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; break;
case TSTRING: case TSTRING:
READ_STR(store, name, sizeof(name)); READ_STR(store, name, sizeof(name));