--- deliantra/server/common/map.C 2006/12/25 14:43:22 1.48 +++ deliantra/server/common/map.C 2006/12/25 14:54:44 1.49 @@ -34,7 +34,6 @@ * Returns the maptile which has a name matching the given argument. * return NULL if no match is found. */ - maptile * has_been_loaded (const char *name) { @@ -42,9 +41,11 @@ if (!name || !*name) return 0; + for (map = first_map; map; map = map->next) if (!strcmp (name, map->path)) break; + return (map); } @@ -198,7 +199,7 @@ dump_map (const maptile *m) { LOG (llevError, "Map %s status: %d.\n", m->path, m->in_memory); - LOG (llevError, "Size: %dx%d Start: %d,%d\n", m->width, m->height, MAP_ENTER_X (m), MAP_ENTER_Y (m)); + LOG (llevError, "Size: %dx%d Start: %d,%d\n", m->width, m->height, m->enter_x, m->enter_y); if (m->msg != NULL) LOG (llevError, "Message:\n%s", m->msg); @@ -612,7 +613,7 @@ for (j = 0; j < m->height; j++) { unique = 0; - for (op = m->at (i, j).bottom; op; op = op->above) + for (op = m->at (i, j).bot; op; op = op->above) { if (op->flag [FLAG_IS_FLOOR] && op->flag [FLAG_UNIQUE]) unique = 1; @@ -639,13 +640,13 @@ */ this->width = 16; this->height = 16; - MAP_RESET_TIMEOUT (this) = 0; - MAP_TIMEOUT (this) = 300; - MAP_ENTER_X (this) = 0; - MAP_ENTER_Y (this) = 0; + this->reset_timeout = 0; + this->timeout = 300; + this->enter_x = 0; + this->enter_y = 0; /*set part to -1 indicating conversion to weather map not yet done */ - MAP_WORLDPARTX (this) = -1; - MAP_WORLDPARTY (this) = -1; + this->worldpartx = -1; + this->worldparty = -1; } /* @@ -1134,8 +1135,8 @@ load_objects (m, thawer, flags & (MAP_BLOCK | MAP_STYLE)); m->in_memory = MAP_IN_MEMORY; - if (!MAP_DIFFICULTY (m)) - MAP_DIFFICULTY (m) = calculate_difficulty (m); + if (!m->difficulty) + m->difficulty = calculate_difficulty (m); set_map_reset_time (m); m->instantiate (); return (m); @@ -1460,7 +1461,7 @@ { mapspace &ms = m->at (i, j); - while (object *op = ms.bottom) + while (object *op = ms.bot) { if (op->head) op = op->head; @@ -1694,10 +1695,10 @@ double avgexp = 0; sint64 total_exp = 0; - if (MAP_DIFFICULTY (m)) + if (m->difficulty) { - LOG (llevDebug, "Using stored map difficulty: %d\n", MAP_DIFFICULTY (m)); - return MAP_DIFFICULTY (m); + LOG (llevDebug, "Using stored map difficulty: %d\n", m->difficulty); + return m->difficulty; } for (x = 0; x < m->width; x++) @@ -1828,7 +1829,7 @@ top_obj = 0; floor_obj = 0; - for (tmp = bottom; tmp; last = tmp, tmp = tmp->above) + for (tmp = bot; tmp; last = tmp, tmp = tmp->above) { /* This could be made additive I guess (two lights better than * one). But if so, it shouldn't be a simple additive - 2 @@ -1988,12 +1989,12 @@ { int timeout; - timeout = MAP_RESET_TIMEOUT (map); + timeout = map->reset_timeout; if (timeout <= 0) timeout = MAP_DEFAULTRESET; if (timeout >= MAP_MAXRESET) timeout = MAP_MAXRESET; - MAP_WHEN_RESET (map) = time (0) + timeout; + map->reset_time = time (0) + timeout; } /* this updates the orig_map->tile_map[tile_num] value after loading