ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/info.C
(Generate patch)

Comparing deliantra/server/socket/info.C (file contents):
Revision 1.23 by root, Thu Dec 21 23:37:06 2006 UTC vs.
Revision 1.28 by root, Sun Dec 31 17:17:23 2006 UTC

185void 185void
186new_draw_info (int flags, int pri, const object *pl, const char *buf) 186new_draw_info (int flags, int pri, const object *pl, const char *buf)
187{ 187{
188 if (flags & NDI_ALL) 188 if (flags & NDI_ALL)
189 { 189 {
190 player *tmppl; 190 for_all_players (pl)
191
192 for (tmppl = first_player; tmppl != NULL; tmppl = tmppl->next)
193 new_draw_info ((flags & ~NDI_ALL), pri, tmppl->ob, buf); 191 new_draw_info (flags & ~NDI_ALL, pri, pl->ob, buf);
194 192
195 return; 193 return;
196 } 194 }
197 195
198 if (!pl || (pl->type == PLAYER && pl->contr == NULL)) 196 if (!pl || pl->type != PLAYER || !pl->contr || !pl->contr->ns)
199 {
200 /* Write to the socket? */
201 print_message (0, NULL, buf);
202 return;
203 }
204
205 if (pl->type != PLAYER)
206 return; 197 return;
207 198
208 if (pri >= pl->contr->listening) 199 if (pri >= pl->contr->listening)
209 return; 200 return;
210 201
211 if ((flags & NDI_COLOR_MASK) == NDI_BLACK && !(flags & NDI_UNIQUE)) 202 if ((flags & NDI_COLOR_MASK) == NDI_BLACK && !(flags & NDI_UNIQUE))
212 /* following prints stuff out, as appropriate */
213 check_output_buffers (pl, buf); 203 check_output_buffers (pl, buf);
214 else 204 else
215 print_message (flags & NDI_COLOR_MASK, pl, buf); 205 print_message (flags & NDI_COLOR_MASK, pl, buf);
216} 206}
217 207
227new_draw_info_format (int flags, int pri, const object *pl, const char *format, ...) 217new_draw_info_format (int flags, int pri, const object *pl, const char *format, ...)
228{ 218{
229 char buf[HUGE_BUF]; 219 char buf[HUGE_BUF];
230 220
231 va_list ap; 221 va_list ap;
232
233 va_start (ap, format); 222 va_start (ap, format);
234
235 vsnprintf (buf, HUGE_BUF, format, ap); 223 vsnprintf (buf, HUGE_BUF, format, ap);
236
237 va_end (ap); 224 va_end (ap);
238 225
239 new_draw_info (flags, pri, pl, buf); 226 new_draw_info (flags, pri, pl, buf);
240} 227}
241 228
309void 296void
310new_info_map_except (int color, maptile * map, object *op, const char *str) 297new_info_map_except (int color, maptile * map, object *op, const char *str)
311{ 298{
312 player *pl; 299 player *pl;
313 300
314 for (pl = first_player; pl != NULL; pl = pl->next) 301 for_all_players (pl)
315 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op) 302 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op)
316 { 303 {
317 new_draw_info (color, 0, pl->ob, str); 304 new_draw_info (color, 0, pl->ob, str);
318 } 305 }
319} 306}
325void 312void
326new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str) 313new_info_map_except2 (int color, maptile * map, object *op1, object *op2, const char *str)
327{ 314{
328 player *pl; 315 player *pl;
329 316
330 for (pl = first_player; pl != NULL; pl = pl->next) 317 for_all_players (pl)
331 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2) 318 if (pl->ob != NULL && pl->ob->map == map && pl->ob != op1 && pl->ob != op2)
332 { 319 {
333 new_draw_info (color, 0, pl->ob, str); 320 new_draw_info (color, 0, pl->ob, str);
334 } 321 }
335} 322}
341void 328void
342new_info_map (int color, maptile * map, const char *str) 329new_info_map (int color, maptile * map, const char *str)
343{ 330{
344 player *pl; 331 player *pl;
345 332
346 for (pl = first_player; pl != NULL; pl = pl->next) 333 for_all_players (pl)
347 if (pl->ob != NULL && pl->ob->map == map) 334 if (pl->ob != NULL && pl->ob->map == map)
348 { 335 {
349 new_draw_info (color, 0, pl->ob, str); 336 new_draw_info (color, 0, pl->ob, str);
350 } 337 }
351} 338}
598 xmax = 0; 585 xmax = 0;
599 ymax = 0; 586 ymax = 0;
600 587
601 for (int x = 0; x < MAGIC_MAP_SIZE; x++) 588 for (int x = 0; x < MAGIC_MAP_SIZE; x++)
602 for (int y = 0; y < MAGIC_MAP_SIZE; y++) 589 for (int y = 0; y < MAGIC_MAP_SIZE; y++)
603 if (map_mark[x + MAP_WIDTH (pl->map) * y] | FACE_FLOOR) 590 if (map_mark[x + pl->map->width * y] | FACE_FLOOR)
604 { 591 {
605 xmin = x < xmin ? x : xmin; 592 xmin = x < xmin ? x : xmin;
606 xmax = x > xmax ? x : xmax; 593 xmax = x > xmax ? x : xmax;
607 ymin = y < ymin ? y : ymin; 594 ymin = y < ymin ? y : ymin;
608 ymax = y > ymax ? y : ymax; 595 ymax = y > ymax ? y : ymax;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines