--- deliantra/server/common/map.C 2006/09/03 00:18:40 1.20 +++ deliantra/server/common/map.C 2006/09/04 15:51:24 1.23 @@ -1,6 +1,6 @@ /* * static char *rcsid_map_c = - * "$Id: map.C,v 1.20 2006/09/03 00:18:40 root Exp $"; + * "$Id: map.C,v 1.23 2006/09/04 15:51:24 root Exp $"; */ /* @@ -505,20 +505,14 @@ */ void load_objects (mapstruct *m, object_thawer &fp, int mapflags) { - int i,j,bufstate=LO_NEWFILE; + int i,j; int unique; object *op, *prev=NULL,*last_more=NULL, *otmp; op=get_object(); op->map = m; /* To handle buttons correctly */ - while((i = load_object (fp, op, bufstate, mapflags))) { - /* Since the loading of the map header does not load an object - * anymore, we need to pass LO_NEWFILE for the first object loaded, - * and then switch to LO_REPEAT for faster loading. - */ - bufstate = LO_REPEAT; - + while((i = load_object (fp, op, mapflags))) { /* if the archetype for the object is null, means that we * got an invalid object. Don't do anything with it - the game * or editor will not be able to do anything with it either. @@ -808,12 +802,12 @@ } } } + if (!end) { LOG(llevError, "Error loading map header - did not find a newline - perhaps file is truncated? Buf=%s\n", buf); return 1; } - /* key is the field name, value is what it should be set * to. We've already done the work to null terminate key, @@ -1003,7 +997,6 @@ mapstruct *m; char pathname[MAX_BUF]; - LOG(llevDebug, "load_original_map: %s (%x)\n", filename,flags); if (flags & MAP_PLAYER_UNIQUE) strcpy(pathname, filename); else if (flags & MAP_OVERLAY) @@ -1011,6 +1004,8 @@ else strcpy(pathname, create_pathname(filename)); + LOG(llevDebug, "load_original_map(%x): %s (%s)\n", flags, filename, pathname); + object_thawer thawer (pathname); if (!thawer) @@ -1172,7 +1167,6 @@ m->in_memory=MAP_LOADING; if (m->tmpname == NULL) /* if we have loaded unique items from */ delete_unique_items(m); /* original map before, don't duplicate them */ - load_object(thawer, NULL, LO_NOREAD,0); load_objects (m, thawer, 0); m->in_memory=MAP_IN_MEMORY; @@ -1528,8 +1522,13 @@ else LOG(llevDebug, "Trying to load map %s.\n", create_pathname(name)); + //0.427459955215454 /var/crossfire/players/Saladon/_scorn_apartment_apartments + //0.414906024932861 + //0.427063941955566 + eval_pv ("$x = Event::time", 1);//D if (!(m = load_original_map(name, (flags & MAP_PLAYER_UNIQUE)))) return (NULL); + eval_pv ("warn \"LOAD \", Event::time - $x", 1);//D fix_auto_apply(m); /* Chests which open as default */