--- deliantra/server/socket/info.C 2006/12/25 11:25:50 1.24 +++ deliantra/server/socket/info.C 2007/01/09 21:32:43 1.31 @@ -1,7 +1,7 @@ - /* CrossFire, A Multiplayer game for X-windows + Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team Copyright (C) 2002 Mark Wedel & Crossfire Development Team Copyright (C) 1992 Frank Tore Johansen @@ -187,29 +187,19 @@ { if (flags & NDI_ALL) { - player *tmppl; - for_all_players (pl) - new_draw_info ((flags & ~NDI_ALL), pri, tmppl->ob, buf); + new_draw_info (flags & ~NDI_ALL, pri, pl->ob, buf); return; } - if (!pl || (pl->type == PLAYER && pl->contr == NULL)) - { - /* Write to the socket? */ - print_message (0, NULL, buf); - return; - } - - if (pl->type != PLAYER) + if (!pl || pl->type != PLAYER || !pl->contr || !pl->contr->ns) return; if (pri >= pl->contr->listening) return; if ((flags & NDI_COLOR_MASK) == NDI_BLACK && !(flags & NDI_UNIQUE)) - /* following prints stuff out, as appropriate */ check_output_buffers (pl, buf); else print_message (flags & NDI_COLOR_MASK, pl, buf); @@ -229,11 +219,8 @@ char buf[HUGE_BUF]; va_list ap; - va_start (ap, format); - vsnprintf (buf, HUGE_BUF, format, ap); - va_end (ap); new_draw_info (flags, pri, pl, buf); @@ -270,7 +257,6 @@ void draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) { - char buf[HUGE_BUF]; if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) @@ -313,9 +299,7 @@ for_all_players (pl) if (pl->ob != NULL && pl->ob->map == map && pl->ob != op) - { - new_draw_info (color, 0, pl->ob, str); - } + new_draw_info (color, 0, pl->ob, str); } /** @@ -329,9 +313,7 @@ for_all_players (pl) if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2) - { - new_draw_info (color, 0, pl->ob, str); - } + new_draw_info (color, 0, pl->ob, str); } /** @@ -345,12 +327,9 @@ for_all_players (pl) if (pl->ob != NULL && pl->ob->map == map) - { - new_draw_info (color, 0, pl->ob, str); - } + new_draw_info (color, 0, pl->ob, str); } - /** * This does nothing now. However, in theory, we should probably send * something to the client and let the client figure out how it might want @@ -520,7 +499,7 @@ * * This function examines the map the player is on, and determines what * is visible. 2 is set for walls or objects that blocks view. 1 - * is for open spaces. map_mark should already have been initialized + * is for open spaces. map_mark should already have been initialised * to zero before this is called. * strength is an initial strength*2 rectangular area that we automatically * see in/penetrate through. @@ -572,7 +551,6 @@ * * Mark Wedel */ - void draw_magic_map (object *pl) { @@ -600,7 +578,7 @@ for (int x = 0; x < MAGIC_MAP_SIZE; x++) for (int y = 0; y < MAGIC_MAP_SIZE; y++) - if (map_mark[x + MAP_WIDTH (pl->map) * y] | FACE_FLOOR) + if (map_mark[x + pl->map->width * y] | FACE_FLOOR) { xmin = x < xmin ? x : xmin; xmax = x > xmax ? x : xmax;