… | |
… | |
185 | void |
185 | void |
186 | new_draw_info (int flags, int pri, const object *pl, const char *buf) |
186 | new_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; |
|
|
191 | |
|
|
192 | for_all_players (tmppl) |
190 | for_all_players (pl) |
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 | |
… | |
… | |
227 | new_draw_info_format (int flags, int pri, const object *pl, const char *format, ...) |
217 | new_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 | |
… | |
… | |
518 | * being nonzero have been changed to check for 1. Also, since |
505 | * being nonzero have been changed to check for 1. Also, since |
519 | * map_mark is a char value, putting 2 in should cause no problems. |
506 | * map_mark is a char value, putting 2 in should cause no problems. |
520 | * |
507 | * |
521 | * This function examines the map the player is on, and determines what |
508 | * This function examines the map the player is on, and determines what |
522 | * is visible. 2 is set for walls or objects that blocks view. 1 |
509 | * is visible. 2 is set for walls or objects that blocks view. 1 |
523 | * is for open spaces. map_mark should already have been initialized |
510 | * is for open spaces. map_mark should already have been initialised |
524 | * to zero before this is called. |
511 | * to zero before this is called. |
525 | * strength is an initial strength*2 rectangular area that we automatically |
512 | * strength is an initial strength*2 rectangular area that we automatically |
526 | * see in/penetrate through. |
513 | * see in/penetrate through. |
527 | */ |
514 | */ |
528 | |
515 | |