version 1.56 | | version 1.57 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_util_c = | | * static char *rcsid_spell_util_c = |
* "$Id: spell_util.c,v 1.56 2001/07/14 04:11:18 mwedel Exp $"; | | * "$Id: spell_util.c,v 1.57 2001/08/21 05:39:31 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
if (out_of_map(m,x,y)) return 0; | | if (out_of_map(m,x,y)) return 0; |
| | |
| | if (OUT_OF_REAL_MAP(m,x,y)) |
| | m = get_map_from_coord(m,&x,&y); |
| | |
/* if there is a wall, certainly can't put the spell there. The blocks | | /* if there is a wall, certainly can't put the spell there. The blocks |
* view check is historic from the old calling functions - my personal | | * view check is historic from the old calling functions - my personal |
* view is that blocks view should not affect spells in any way, but | | * view is that blocks view should not affect spells in any way, but |
| | |
{24,9,-1}}; /* 48 */ | | {24,9,-1}}; /* 48 */ |
| | |
/* Recursive routine to step back and see if we can | | /* Recursive routine to step back and see if we can |
find a path to that monster that we found. If not, | | * find a path to that monster that we found. If not, |
we don't bother going toward it. Returns 1 if we | | * we don't bother going toward it. Returns 1 if we |
can see a direct way to get it.*/ | | * can see a direct way to get it |
| | * Modified to be map tile aware -.MSW |
| | */ |
| | |
| | |
int can_see_monsterP(mapstruct *m, int x, int y,int dir) { | | int can_see_monsterP(mapstruct *m, int x, int y,int dir) { |
int dx, dy; /* delta (dx) */ | | int dx, dy; /* delta (dx) */ |
| | |
dx = freearr_x[dir]; | | |
dy = freearr_y[dir]; | | |
| | |
if(dir<0) return 0; /* exit condition: invalid direction */ | | if(dir<0) return 0; /* exit condition: invalid direction */ |
if(wall(m,x + dx,y+dy)) return 0; | | |
| | dx = x + freearr_x[dir]; |
| | dy = y + freearr_y[dir]; |
| | |
| | m = get_map_from_coord(m, &dx, &dy); |
| | |
| | if(wall(m,dx,dy)) return 0; |
| | |
/* yes, can see. */ | | /* yes, can see. */ |
if(dir < 9) return 1; | | if(dir < 9) return 1; |