| version 1.9 | | version 1.10 |
|---|
| | |
| /* | | /* |
| * static char *rcsid_xutil_c = | | * static char *rcsid_xutil_c = |
| * "$Id: xutil.c,v 1.9 2003/05/25 23:37:54 mwedel Exp $"; | | * "$Id: xutil.c,v 1.10 2003/10/06 07:04:02 mwedel Exp $"; |
| */ | | */ |
| /* | | /* |
| Crossfire client, a client program for the crossfire program. | | Crossfire client, a client program for the crossfire program. |
| | |
| */ | | */ |
| static int need_recenter_map( int dx, int dy) | | static int need_recenter_map( int dx, int dy) |
| { | | { |
| | | if( pl_pos.x + dx + use_config[CONFIG_MAPWIDTH] + MAX_MAP_OFFSET >= the_map.x || |
| if( pl_pos.x + dx + use_config[CONFIG_MAPWIDTH] >= the_map.x || | | pl_pos.y + dy + use_config[CONFIG_MAPHEIGHT] + MAX_MAP_OFFSET >= the_map.y || |
| pl_pos.y + dx + use_config[CONFIG_MAPHEIGHT] >= the_map.y || | | |
| pl_pos.x + dx <= 0 || | | pl_pos.x + dx <= 0 || |
| pl_pos.y + dy <= 0 ) | | pl_pos.y + dy <= 0 ) |
| { | | { |
| | |
| * virtual maps with large views this could happen before our 0,0 view | | * virtual maps with large views this could happen before our 0,0 view |
| * coordinate is within 1/4 of the edge) we shift to the center. | | * coordinate is within 1/4 of the edge) we shift to the center. |
| */ | | */ |
| if( pl_pos.x <= (map->x/4) || pl_pos.x >= (map->x*3/4) || | | if( pl_pos.x <= (map->x/4) || (pl_pos.x +MAX_MAP_OFFSET) >= (map->x*3/4) || |
| pl_pos.x + use_config[CONFIG_MAPWIDTH] + 1 >= map->x ) | | pl_pos.x + use_config[CONFIG_MAPWIDTH] + 1 >= map->x ) |
| { | | { |
| x_shift= map->x/2 - pl_pos.x; | | x_shift= map->x/2 - pl_pos.x; |
| } | | } |
| if( pl_pos.y <= (map->y/4) || pl_pos.y >= (map->y*3/4) || | | if( pl_pos.y <= (map->y/4) || (pl_pos.y + MAX_MAP_OFFSET) >= (map->y*3/4) || |
| pl_pos.y + use_config[CONFIG_MAPHEIGHT] + 1 >= map->y ) | | pl_pos.y + use_config[CONFIG_MAPHEIGHT] + 1 >= map->y ) |
| { | | { |
| y_shift= map->y/2 - pl_pos.y; | | y_shift= map->y/2 - pl_pos.y; |