version 1.12 | | version 1.13 |
---|
| | |
/* | | /* |
* static char *rcsid_sock_info_c = | | * static char *rcsid_sock_info_c = |
* "$Id: info.c,v 1.12 2003/01/08 08:39:21 mwedel Exp $"; | | * "$Id: info.c,v 1.13 2003/01/17 06:23:55 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
} | | } |
| | |
| | |
/* We set this size - this is to make magic map work properly on | | |
* tiled maps. There is no requirement that this matches the | | |
* tiled maps size - it just seemed like a reasonable value. | | |
* Magic map code now always starts out putting the player in the | | |
* center of the map - this makes the most sense when dealing | | |
* with tiled maps. | | |
* We also figure out the magicmap color to use as we process the | | |
* spaces - this is more efficient as we already have up to date | | |
* map pointers. | | |
*/ | | |
| | |
#define MAGIC_MAP_SIZE 50 | | |
#define MAGIC_MAP_HALF MAGIC_MAP_SIZE/2 | | |
| | |
/* Takes a player, the map_mark array and an x and y starting position. | | /* Takes a player, the map_mark array and an x and y starting position. |
* pl is the player. | | * pl is the player. |
* px, py are offsets from the player. | | * px, py are offsets from the player. |
| | |
if (f == blank_face) | | if (f == blank_face) |
f= GET_MAP_FACE(mp, nx, ny, 2); | | f= GET_MAP_FACE(mp, nx, ny, 2); |
| | |
if (mflags & (P_BLOCKSVIEW | P_NO_MAGIC)) | | /* Should probably have P_NO_MAGIC here also, but then shops don't |
| | * work. |
| | */ |
| | if (mflags & P_BLOCKSVIEW) |
map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE* (MAGIC_MAP_HALF + y)] = FACE_WALL | (f?f->magicmap:0); | | map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE* (MAGIC_MAP_HALF + y)] = FACE_WALL | (f?f->magicmap:0); |
else { | | else { |
map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE* (MAGIC_MAP_HALF + y)] = FACE_FLOOR | (f?f->magicmap:0); | | map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE* (MAGIC_MAP_HALF + y)] = FACE_FLOOR | (f?f->magicmap:0); |
| | |
nx = pl->x + x; | | nx = pl->x + x; |
ny = pl->y + y; | | ny = pl->y + y; |
mflags = get_map_flags(pl->map, &mp, nx, ny, &nx, &ny); | | mflags = get_map_flags(pl->map, &mp, nx, ny, &nx, &ny); |
| | if (mflags & P_OUT_OF_MAP) |
| | continue; |
| | else { |
f= GET_MAP_FACE(mp, nx, ny, 0); | | f= GET_MAP_FACE(mp, nx, ny, 0); |
if (f == blank_face) | | if (f == blank_face) |
f= GET_MAP_FACE(mp, nx, ny, 1); | | f= GET_MAP_FACE(mp, nx, ny, 1); |
if (f == blank_face) | | if (f == blank_face) |
f= GET_MAP_FACE(mp, nx, ny, 2); | | f= GET_MAP_FACE(mp, nx, ny, 2); |
| | } |
| | |
if (mflags & (P_BLOCKSVIEW | P_NO_MAGIC)) | | if (mflags & P_BLOCKSVIEW) |
map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE* (MAGIC_MAP_HALF + y)] = FACE_WALL | (f?f->magicmap:0); | | map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE* (MAGIC_MAP_HALF + y)] = FACE_WALL | (f?f->magicmap:0); |
else { | | else { |
map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE* (MAGIC_MAP_HALF + y)] = FACE_FLOOR | (f?f->magicmap:0); | | map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE* (MAGIC_MAP_HALF + y)] = FACE_FLOOR | (f?f->magicmap:0); |