--- deliantra/server/common/los.C 2006/12/21 23:37:05 1.10 +++ deliantra/server/common/los.C 2006/12/23 13:56:25 1.11 @@ -521,13 +521,9 @@ void update_all_map_los (maptile *map) { - player *pl; - - for (pl = first_player; pl != NULL; pl = pl->next) - { - if (pl->ob->map == map) - pl->do_los = 1; - } + for_all_players (pl) + if (pl->ob->map == map) + pl->do_los = 1; } @@ -547,9 +543,7 @@ void update_all_los (const maptile *map, int x, int y) { - player *pl; - - for (pl = first_player; pl; pl = pl->next) + for_all_players (pl) { /* Player should not have a null map, but do this * check as a safety @@ -614,7 +608,6 @@ * Debug-routine which dumps the array which specifies the visible * area of a player. Triggered by the z key in DM mode. */ - void print_los (object *op) { @@ -622,20 +615,25 @@ char buf[50], buf2[10]; strcpy (buf, " "); + for (x = 0; x < op->contr->ns->mapx; x++) { sprintf (buf2, "%2d", x); strcat (buf, buf2); } + new_draw_info (NDI_UNIQUE, 0, op, buf); + for (y = 0; y < op->contr->ns->mapy; y++) { sprintf (buf, "%2d:", y); + for (x = 0; x < op->contr->ns->mapx; x++) { sprintf (buf2, " %1d", op->contr->blocked_los[x][y]); strcat (buf, buf2); } + new_draw_info (NDI_UNIQUE, 0, op, buf); } } @@ -648,9 +646,7 @@ void make_sure_seen (const object *op) { - player *pl; - - for (pl = first_player; pl; pl = pl->next) + for_all_players (pl) if (pl->ob->map == op->map && pl->ob->y - pl->ns->mapy / 2 <= op->y && pl->ob->y + pl->ns->mapy / 2 >= op->y && pl->ob->x - pl->ns->mapx / 2 <= op->x && pl->ob->x + pl->ns->mapx / 2 >= op->x) @@ -666,9 +662,7 @@ void make_sure_not_seen (const object *op) { - player *pl; - - for (pl = first_player; pl; pl = pl->next) + for_all_players (pl) if (pl->ob->map == op->map && pl->ob->y - pl->ns->mapy / 2 <= op->y && pl->ob->y + pl->ns->mapy / 2 >= op->y && pl->ob->x - pl->ns->mapx / 2 <= op->x && pl->ob->x + pl->ns->mapx / 2 >= op->x)