--- deliantra/server/common/map.C 2006/08/28 14:05:23 1.10 +++ deliantra/server/common/map.C 2006/08/28 16:52:51 1.12 @@ -1,6 +1,6 @@ /* * static char *rcsid_map_c = - * "$Id: map.C,v 1.10 2006/08/28 14:05:23 root Exp $"; + * "$Id: map.C,v 1.12 2006/08/28 16:52:51 root Exp $"; */ /* @@ -795,7 +795,7 @@ * return 0 on success, 1 on failure. */ -static int load_map_header(FILE *fp, mapstruct *m) +static int load_map_header(object_thawer &fp, mapstruct *m) { char buf[HUGE_BUF], msgbuf[HUGE_BUF], maplorebuf[HUGE_BUF], *key=NULL, *value, *end; int msgpos=0; @@ -895,7 +895,11 @@ * for compatibility reasons. The new values (second) are * what really should be used. */ - else if (!strcmp(key,"hp") || !strcmp(key, "enter_x")) { + else if (!strcmp(key,"oid")) { + fp.get (m, atoi(value)); + } else if (!strcmp(key, "attach")) { + m->attach = add_string (value); + } else if (!strcmp(key,"hp") || !strcmp(key, "enter_x")) { m->enter_x = atoi(value); } else if (!strcmp(key,"sp") || !strcmp(key, "enter_y")) { m->enter_y = atoi(value); @@ -1038,7 +1042,7 @@ m = get_linked_map(); strcpy (m->path, filename); - if (load_map_header(fp, m)) { + if (load_map_header(thawer, m)) { LOG(llevError,"Error loading map header for %s, flags=%d\n", filename, flags); delete_map(m); @@ -1054,7 +1058,7 @@ if (!MAP_DIFFICULTY(m)) MAP_DIFFICULTY(m)=calculate_difficulty(m); set_map_reset_time(m); - INVOKE_MAP (INSTANTIATE, m); + m->instantiate (); return (m); } @@ -1336,6 +1340,7 @@ if (m->tile_path[i]) fprintf (fp, "tile_path_%d %s\n", i + 1, m->tile_path[i]); + fp.put (m); fprintf (fp, "end\n"); /* In the game save unique items in the different file, but @@ -1468,6 +1473,9 @@ if (!m) return; + + m->clear (); + if (m->in_memory == MAP_IN_MEMORY) { /* change to MAP_SAVING, even though we are not, * so that remove_ob doesn't do as much work.