version 1.75 | | version 1.76 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.75 2005/04/17 04:25:55 mwedel Exp $"; | | * "$Id: monster.c,v 1.76 2005/04/18 07:14:38 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
/* Check the spaces with the max light radius to see if any of them | | /* Check the spaces with the max light radius to see if any of them |
* have lights, and if any of them light the player enough, then return 1. | | * have lights, and if any of them light the player enough, then return 1. |
*/ | | */ |
for (x = op->x - (2*MAX_LIGHT_RADII); x< op->x + (2*MAX_LIGHT_RADII); x++) { | | for (x = op->x - MAX_LIGHT_RADII; x< op->x + MAX_LIGHT_RADII; x++) { |
for (y = op->y - (2*MAX_LIGHT_RADII); y< op->y + (2*MAX_LIGHT_RADII); y++) { | | for (y = op->y - MAX_LIGHT_RADII; y< op->y + MAX_LIGHT_RADII; y++) { |
m = op->map; | | m = op->map; |
nx = x; | | nx = x; |
ny = y; | | ny = y; |
| | |
| | |
x1 = abs(x - op->x)*abs(x - op->x); | | x1 = abs(x - op->x)*abs(x - op->x); |
y1 = abs(y - op->y)*abs(y - op->y); | | y1 = abs(y - op->y)*abs(y - op->y); |
if (isqrt(x1 + y1) > 0) return 1; | | if (isqrt(x1 + y1) < GET_MAP_LIGHT(m, nx, ny)) return 1; |
} | | } |
} | | } |
} | | } |