--- deliantra/server/common/map.C 2006/08/31 17:54:14 1.18 +++ deliantra/server/common/map.C 2006/09/03 00:18:40 1.20 @@ -1,6 +1,6 @@ /* * static char *rcsid_map_c = - * "$Id: map.C,v 1.18 2006/08/31 17:54:14 root Exp $"; + * "$Id: map.C,v 1.20 2006/09/03 00:18:40 root Exp $"; */ /* @@ -484,14 +484,8 @@ op->head = tmp; op->map = m; last->more = op; - if (tmp->name != op->name) { - if (op->name) free_string(op->name); - op->name = add_string(tmp->name); - } - if (tmp->title != op->title) { - if (op->title) free_string(op->title); - op->title = add_string(tmp->title); - } + op->name = tmp->name; + op->title = tmp->title; /* we could link all the parts onto tmp, and then just * call insert_ob_in_map once, but the effect is the same, * as insert_ob_in_map will call itself with each part, and @@ -620,12 +614,9 @@ */ mapstruct *get_linked_map(void) { - mapstruct *map=(mapstruct *) calloc(1,sizeof(mapstruct)); + mapstruct *map = new mapstruct; mapstruct *mp; - if(map==NULL) - fatal(OUT_OF_MEMORY); - for(mp=first_map;mp!=NULL&&mp->next!=NULL;mp=mp->next); if(mp==NULL) first_map=map; @@ -890,7 +881,7 @@ else if (!strcmp(key,"oid")) { fp.get (m, atoi(value)); } else if (!strcmp(key, "attach")) { - m->attach = add_string (value); + m->attach = value; } else if (!strcmp(key,"hp") || !strcmp(key, "enter_x")) { m->enter_x = atoi(value); } else if (!strcmp(key,"sp") || !strcmp(key, "enter_y")) { @@ -1395,18 +1386,6 @@ free_object(op); } } -#ifdef MANY_CORES - /* I see periodic cores on metalforge where a map has been swapped out, but apparantly - * an item on that map was not saved - look for that condition and die as appropriate - - * this leaves more of the map data intact for better debugging. - */ - for (op=objects; op!=NULL; op=op->next) { - if (!QUERY_FLAG(op, FLAG_REMOVED) && op->map == m) { - LOG(llevDebug,"free_all_objects: object %s still on map after it should have been freed\n", op->name); - abort(); - } - } -#endif } /* @@ -1496,7 +1475,7 @@ else last->next = m->next; - free (m); + delete m; }