version 1.63 | | version 1.64 |
---|
| | |
/* | | /* |
* static char *rcsid_map_c = | | * static char *rcsid_map_c = |
* "$Id: map.c,v 1.63 2004/02/28 10:40:56 ryo_saeba Exp $"; | | * "$Id: map.c,v 1.64 2004/04/16 06:23:41 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* to block it from moving there. | | * to block it from moving there. |
* Returns TRUE if the space is blocked by something other than the | | * Returns TRUE if the space is blocked by something other than the |
* monster. | | * monster. |
| | * m, x, y are the target map/coordinates - needed for map tiling. |
| | * the coordinates & map passed in should have been updated for tiling |
| | * by the caller. |
*/ | | */ |
| | |
int blocked_link(object *ob, int x, int y) { | | int blocked_link(object *ob, mapstruct *m, int sx, int sy) { |
object *tmp; | | object *tmp; |
mapstruct *m; | | |
sint16 sx, sy; | | |
int mflags; | | int mflags; |
| | |
sx = x; | | /* Make sure the coordinates are valid - they should be, as caller should |
sy = y; | | * have already checked this. |
m = ob->map; | | */ |
| | if (OUT_OF_REAL_MAP(m, sx, sy)) { |
mflags = get_map_flags(m, &m, sx, sy, &sx, &sy); | | LOG(llevError,"blocked_link: Past map, x, y coordinates outside of map\n"); |
| | |
if (mflags & P_OUT_OF_MAP) | | |
return 1; | | return 1; |
| | } |
| | |
| | /* Save some cycles - instead of calling get_map_flags(), just get the value |
| | * directly. |
| | */ |
| | mflags = m->spaces[sx + m->width * sy].flags; |
| | |
/* If space is currently not blocked by anything, no need to | | /* If space is currently not blocked by anything, no need to |
* go further. Not true for players - all sorts of special | | * go further. Not true for players - all sorts of special |