From: Christian Heller Date: Wed, 20 Nov 2013 04:14:16 +0000 (+0100) Subject: Fixed map object action bug deriving from wrong order of reading/writing MapObject... X-Git-Tag: tce~925 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/te"st.html?a=commitdiff_plain;h=470540c932775c26a65513935bbc1c17dc19468d;p=plomrogue Fixed map object action bug deriving from wrong order of reading/writing MapObject.command/.arg/.progress. --- diff --git a/src/map_objects.c b/src/map_objects.c index 0107aff..1a598cb 100644 --- a/src/map_objects.c +++ b/src/map_objects.c @@ -33,7 +33,7 @@ static void write_map_object(FILE * file, struct MapObj * mo) char line[size]; sprintf(line, "%d %d %d %d %d %d %d %d", mo->id, mo->type, mo->lifepoints, mo->pos.y, mo->pos.x, - mo->progress, mo->command, mo->arg); + mo->command, mo->arg, mo->progress); for (mo_ptr = mo->owns; NULL != mo_ptr; mo_ptr = mo_ptr->next) { sprintf(line + strlen(line), " %d", mo_ptr->id); @@ -138,9 +138,9 @@ extern void read_map_objects(FILE * file, char * line, int linemax) mo->lifepoints = atoi(strtok(NULL, delim)); mo->pos.y = atoi(strtok(NULL, delim)); mo->pos.x = atoi(strtok(NULL, delim)); - mo->progress = atoi(strtok(NULL, delim));; mo->command = atoi(strtok(NULL, delim));; mo->arg = atoi(strtok(NULL, delim));; + mo->progress = atoi(strtok(NULL, delim));; mo->owns = NULL; if (mo->id > world.map_obj_count) {