… | |
… | |
1452 | |
1452 | |
1453 | /** |
1453 | /** |
1454 | * Return whether map2 is adjacent to map1. If so, store the distance from |
1454 | * Return whether map2 is adjacent to map1. If so, store the distance from |
1455 | * map1 to map2 in dx/dy. |
1455 | * map1 to map2 in dx/dy. |
1456 | */ |
1456 | */ |
1457 | static int |
1457 | int |
1458 | adjacent_map (const maptile *map1, const maptile *map2, int *dx, int *dy) |
1458 | adjacent_map (const maptile *map1, const maptile *map2, int *dx, int *dy) |
1459 | { |
1459 | { |
1460 | if (!map1 || !map2) |
1460 | if (!map1 || !map2) |
1461 | return 0; |
1461 | return 0; |
1462 | |
1462 | |
… | |
… | |
1634 | * flags has no meaning for this function at this time - I kept it in to |
1634 | * flags has no meaning for this function at this time - I kept it in to |
1635 | * be more consistant with the above function and also in case they are needed |
1635 | * be more consistant with the above function and also in case they are needed |
1636 | * for something in the future. Also, since no object is pasted, the best |
1636 | * for something in the future. Also, since no object is pasted, the best |
1637 | * field of the rv_vector is set to NULL. |
1637 | * field of the rv_vector is set to NULL. |
1638 | */ |
1638 | */ |
1639 | |
|
|
1640 | void |
1639 | void |
1641 | get_rangevector_from_mapcoord (const maptile *m, int x, int y, const object *op2, rv_vector * retval, int flags) |
1640 | get_rangevector_from_mapcoord (const maptile *m, int x, int y, const object *op2, rv_vector *retval, int flags) |
1642 | { |
1641 | { |
1643 | if (!adjacent_map (m, op2->map, &retval->distance_x, &retval->distance_y)) |
1642 | if (!adjacent_map (m, op2->map, &retval->distance_x, &retval->distance_y)) |
1644 | { |
1643 | { |
1645 | /* be conservative and fill in _some_ data */ |
1644 | /* be conservative and fill in _some_ data */ |
1646 | retval->distance = 100000; |
1645 | retval->distance = 100000; |