--- deliantra/server/socket/info.C 2007/03/01 12:28:17 1.34 +++ deliantra/server/socket/info.C 2007/03/11 02:12:45 1.35 @@ -421,7 +421,6 @@ sprintf (buf, "Player: %s %s", (const char *) pl->name, (const char *) pl->contr->own_title); } - /** * Helper for magic map creation. * @@ -439,7 +438,6 @@ int x, y, dx, dy, mflags; sint16 nx, ny; maptile *mp; - facetile *f; for (dx = -1; dx <= 1; dx++) { @@ -461,20 +459,24 @@ if (map_mark[MAGIC_MAP_HALF + x + MAGIC_MAP_SIZE * (MAGIC_MAP_HALF + y)] == 0) { - f = GET_MAP_FACE (mp, nx, ny, 0); - if (f == blank_face) - f = GET_MAP_FACE (mp, nx, ny, 1); + int f = GET_MAP_FACE (mp, nx, ny, 0); if (f == blank_face) - f = GET_MAP_FACE (mp, nx, ny, 2); + { + f = GET_MAP_FACE (mp, nx, ny, 1); + if (f == blank_face) + f = GET_MAP_FACE (mp, nx, ny, 2); + } + + int magicmap = faces [f].magicmap; /* 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 | magicmap; 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 | magicmap; magic_mapping_mark_recursive (pl, map_mark, x, y); } } @@ -482,7 +484,6 @@ } } - /** * Creates magic map for player. * @@ -498,14 +499,12 @@ * strength is an initial strength*2 rectangular area that we automatically * see in/penetrate through. */ - void magic_mapping_mark (object *pl, char *map_mark, int strength) { int x, y, mflags; sint16 nx, ny; maptile *mp; - facetile *f; for (x = -strength; x < strength; x++) { @@ -514,23 +513,26 @@ mp = pl->map; nx = pl->x + x; ny = pl->y + y; + mflags = get_map_flags (pl->map, &mp, nx, ny, &nx, &ny); if (mflags & P_OUT_OF_MAP) continue; - else + + int f = GET_MAP_FACE (mp, nx, ny, 0); + if (f == blank_face) { - f = GET_MAP_FACE (mp, nx, ny, 0); - if (f == blank_face) - f = GET_MAP_FACE (mp, nx, ny, 1); + f = GET_MAP_FACE (mp, nx, ny, 1); if (f == blank_face) f = GET_MAP_FACE (mp, nx, ny, 2); } + int magicmap = faces [f].magicmap; + 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 | magicmap; 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 | magicmap; magic_mapping_mark_recursive (pl, map_mark, x, y); } }