+ char * f_name = "read_map_objects()";
+ struct MapObj ** mo_ptr_ptr = &world.map_objs;
+ char * delim = " ";
+ struct MapObj * mo;
+ fpos_t pos;
+ exit_err(-1 == fgetpos(file, &pos), f_name);
+ while (try_fgets(line, linemax + 1, file, f_name))
+ {
+ 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->progress = atoi(strtok(NULL, delim));;
+ mo->command = atoi(strtok(NULL, delim));;
+ mo->arg = atoi(strtok(NULL, delim));;
+ mo->owns = NULL;
+ if (mo->id > world.map_obj_count)
+ {
+ world.map_obj_count = mo->id;
+ }
+ * 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))