--- deliantra/server/common/map.C 2006/08/28 14:05:23 1.10 +++ deliantra/server/common/map.C 2006/08/29 09:35:51 1.13 @@ -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.13 2006/08/29 09:35:51 elmex 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); @@ -947,8 +951,6 @@ m->sky = atoi(value); } else if (!strcmp(key, "nosmooth")) { m->nosmooth = atoi(value); - } else if (!strcmp(key, "safe_map")) { - m->safe_map = atoi(value); } else if (!strncmp(key,"tile_path_", 10)) { int tile=atoi(key+10); @@ -1038,7 +1040,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 +1056,7 @@ if (!MAP_DIFFICULTY(m)) MAP_DIFFICULTY(m)=calculate_difficulty(m); set_map_reset_time(m); - INVOKE_MAP (INSTANTIATE, m); + m->instantiate (); return (m); } @@ -1327,8 +1329,6 @@ fprintf (fp, "sky %d\n", m->sky); if (m->nosmooth) fprintf (fp, "nosmooth %d\n", m->nosmooth); - if (m->safe_map) - fprintf (fp, "safe_map %d\n", m->safe_map); /* Save any tiling information, except on overlays */ if (flag != 2) @@ -1336,6 +1336,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 +1469,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.