--- deliantra/server/common/map.C 2007/08/24 00:26:09 1.117 +++ deliantra/server/common/map.C 2007/08/30 07:28:24 1.123 @@ -385,21 +385,21 @@ for (int i = 0; i < size (); ++i) { - int unique = 0; + bool unique = 0; + for (object *op = spaces [i].bot; op; op = op->above) { - if (op->flag [FLAG_UNIQUE] && op->flag [FLAG_IS_FLOOR]) - unique = 1; + unique |= op->flag [FLAG_UNIQUE] && op->flag [FLAG_IS_FLOOR]; - if (!op->can_map_save ()) + if (expect_false (!op->can_map_save ())) continue; - if (unique || op->flag [FLAG_UNIQUE]) + if (expect_false (unique || op->flag [FLAG_UNIQUE])) { if (flags & IO_UNIQUES) op->write (f); } - else if (flags & IO_OBJECTS) + else if (expect_true (flags & IO_OBJECTS)) op->write (f); } } @@ -679,7 +679,7 @@ case KW_tile_path_4: thawer.get (tile_path [3]); break; case KW_ERROR: - set_key (thawer.kw_str, thawer.value); + set_key_text (thawer.kw_str, thawer.value); break; case KW_end: @@ -891,7 +891,6 @@ if (QUERY_FLAG (op, FLAG_IS_FLOOR) || QUERY_FLAG (op, FLAG_OBJ_ORIGINAL) - || QUERY_FLAG (op, FLAG_OBJ_SAVE_ON_OVL) || QUERY_FLAG (op, FLAG_UNIQUE) || QUERY_FLAG (op, FLAG_OVERLAY_FLOOR) || QUERY_FLAG (op, FLAG_UNPAID) @@ -1229,12 +1228,12 @@ bool maptile::tile_available (int dir, bool load) { - if (tile_map[dir] && (!load || tile_map[dir]->in_memory == MAP_IN_MEMORY)) - return 1; - if (!tile_path[dir]) return 0; + if (tile_map[dir] && (!load || tile_map[dir]->in_memory == MAP_IN_MEMORY)) + return 1; + if ((tile_map[dir] = find_async (tile_path[dir], this, load))) return 1; @@ -1261,7 +1260,7 @@ if (x < 0) { - if (!m->tile_available (3, 0)) + if (!m->tile_available (3)) return 1; return out_of_map (m->tile_map[3], x + m->tile_map[3]->width, y); @@ -1269,7 +1268,7 @@ if (x >= m->width) { - if (!m->tile_available (1, 0)) + if (!m->tile_available (1)) return 1; return out_of_map (m->tile_map[1], x - m->width, y); @@ -1277,7 +1276,7 @@ if (y < 0) { - if (!m->tile_available (0, 0)) + if (!m->tile_available (0)) return 1; return out_of_map (m->tile_map[0], x, y + m->tile_map[0]->height); @@ -1285,7 +1284,7 @@ if (y >= m->height) { - if (!m->tile_available (2, 0)) + if (!m->tile_available (2)) return 1; return out_of_map (m->tile_map[2], x, y - m->height); @@ -1310,7 +1309,7 @@ { if (x < 0) { - if (!tile_available (3, 1)) + if (!tile_available (3)) return 0; x += tile_map[3]->width; @@ -1319,7 +1318,7 @@ if (x >= width) { - if (!tile_available (1, 1)) + if (!tile_available (1)) return 0; x -= width; @@ -1328,7 +1327,7 @@ if (y < 0) { - if (!tile_available (0, 1)) + if (!tile_available (0)) return 0; y += tile_map[0]->height; @@ -1337,7 +1336,7 @@ if (y >= height) { - if (!tile_available (2, 1)) + if (!tile_available (2)) return 0; y -= height; @@ -1360,7 +1359,7 @@ if (!map1 || !map2) return 0; - //TODO: this doesn't actually check corretcly when intermediate maps are not loaded + //TODO: this doesn't actually check correctly when intermediate maps are not loaded //fix: compare paths instead (this is likely faster, too!) if (map1 == map2) {