--- deliantra/server/common/map.C 2007/02/07 23:50:01 1.85 +++ deliantra/server/common/map.C 2007/02/15 21:07:48 1.87 @@ -544,12 +544,10 @@ if (skip_header) for (;;) { - keyword kw = thawer.get_kv (); - - if (kw == KW_end) + if (thawer.kw == KW_end) break; - thawer.skip_kv (kw); + thawer.skip_kv (); } return _load_objects (thawer); @@ -805,7 +803,7 @@ return true; default: - if (!thawer.parse_error (kw, "map", 0)) + if (!thawer.parse_error ("map", 0)) return false; break; } @@ -1583,9 +1581,9 @@ if (!adjacent_map (op1->map, op2->map, &retval->distance_x, &retval->distance_y)) { /* be conservative and fill in _some_ data */ - retval->distance = 100000; - retval->distance_x = 32767; - retval->distance_y = 32767; + retval->distance = 10000; + retval->distance_x = 10000; + retval->distance_y = 10000; retval->direction = 0; retval->part = 0; } @@ -1600,7 +1598,6 @@ /* If this is multipart, find the closest part now */ if (!(flags & 0x1) && op1->more) { - object *tmp; int best_distance = retval->distance_x * retval->distance_x + retval->distance_y * retval->distance_y, tmpi; /* we just take the offset of the piece to head to figure @@ -1609,7 +1606,7 @@ * same axis as is used for multipart objects, the simply arithmetic * below works. */ - for (tmp = op1->more; tmp != NULL; tmp = tmp->more) + for (object *tmp = op1->more; tmp; tmp = tmp->more) { tmpi = (op1->x - tmp->x + retval->distance_x) * (op1->x - tmp->x + retval->distance_x) + (op1->y - tmp->y + retval->distance_y) * (op1->y - tmp->y + retval->distance_y); @@ -1628,7 +1625,7 @@ } retval->part = best; - retval->distance = idistance (retval->distance_x, retval->distance_y); + retval->distance = upos_max (abs (retval->distance_x), abs (retval->distance_y)); retval->direction = find_dir_2 (-retval->distance_x, -retval->distance_y); } }