+ write_map_object(file, mo);
+ mo = mo->next;
+ }
+}
+
+
+
+extern void read_map_objects(FILE * file, char * line, int linemax)
+{
+ char * f_name = "read_map_objects()";
+ struct MapObj ** mo_ptr_ptr = &world.map_objs;
+ char * delim = " ";
+ fpos_t pos;
+ exit_err(-1 == fgetpos(file, &pos), f_name);
+ while (try_fgets(line, linemax + 1, file, f_name))
+ {
+ struct MapObj * mo = try_malloc(sizeof(struct MapObj), f_name);
+ mo->next = NULL;
+ mo->id = atoi(strtok(line, delim));
+ mo->type = atoi(strtok(NULL, delim));
+ mo->lifepoints = atoi(strtok(NULL, delim));
+ mo->pos.y = atoi(strtok(NULL, delim));
+ mo->pos.x = 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;
+ * mo_ptr_ptr = mo;
+ mo_ptr_ptr = &mo->next;
+ }
+ exit_err(-1 == fsetpos(file, &pos), f_name);
+ while (try_fgets(line, linemax + 1, file, f_name))
+ {
+ uint8_t id = atoi(strtok(line, delim));
+ uint8_t i;
+ for (i = 0; i < 7; i++, strtok(NULL, delim));
+ char * owned = strtok(NULL, "\n");
+ if (NULL != owned)