… | |
… | |
139 | /** |
139 | /** |
140 | * Sends message to player(s). |
140 | * Sends message to player(s). |
141 | * |
141 | * |
142 | * flags is various flags - mostly color, plus a few specials. |
142 | * flags is various flags - mostly color, plus a few specials. |
143 | * |
143 | * |
144 | * pri is priority. It is a little odd - the lower the value, the more |
144 | * pri is unused. |
145 | * important it is. Thus, 0 gets sent no matter what. Otherwise, the |
|
|
146 | * value must be less than the listening level that the player has set. |
|
|
147 | * Unfortunately, there is no clear guideline on what each level does what. |
|
|
148 | * |
145 | * |
149 | * pl can be passed as NULL - in fact, this will be done if NDI_ALL is set |
146 | * pl can be passed as NULL - in fact, this will be done if NDI_ALL is set |
150 | * in the flags. |
147 | * in the flags. |
151 | * |
148 | * |
152 | * If message is black, and not NDI_UNIQUE, gets sent through output buffers. |
149 | * If message is black, and not NDI_UNIQUE, gets sent through output buffers. |
… | |
… | |
156 | new_draw_info (int flags, int pri, const object *op, const char *buf) |
153 | new_draw_info (int flags, int pri, const object *op, const char *buf) |
157 | { |
154 | { |
158 | if (flags & NDI_ALL) |
155 | if (flags & NDI_ALL) |
159 | { |
156 | { |
160 | for_all_players (pl) |
157 | for_all_players (pl) |
161 | new_draw_info (flags & ~NDI_ALL, pri, pl->ob, buf); |
158 | new_draw_info (flags & ~NDI_ALL, 0, pl->ob, buf); |
162 | } |
159 | } |
163 | else |
160 | else |
164 | { |
161 | { |
165 | if (!op || !op->contr || !op->contr->ns) |
162 | if (!op || !op->contr || !op->contr->ns) |
166 | return; |
|
|
167 | |
|
|
168 | if (pri >= op->contr->listening) |
|
|
169 | return; |
163 | return; |
170 | |
164 | |
171 | if ((flags & (NDI_COLOR_MASK | NDI_UNIQUE)) != NDI_BLACK |
165 | if ((flags & (NDI_COLOR_MASK | NDI_UNIQUE)) != NDI_BLACK |
172 | || !op->contr->ns->msg_suppressed (buf)) |
166 | || !op->contr->ns->msg_suppressed (buf)) |
173 | print_message (flags & NDI_COLOR_MASK, op, buf); |
167 | print_message (flags & NDI_COLOR_MASK, op, buf); |
… | |
… | |
198 | void |
192 | void |
199 | draw_ext_info (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage) |
193 | draw_ext_info (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage) |
200 | { |
194 | { |
201 | |
195 | |
202 | if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) |
196 | if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) |
203 | return; |
|
|
204 | |
|
|
205 | if (pri >= pl->contr->listening) |
|
|
206 | return; |
197 | return; |
207 | |
198 | |
208 | if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type)) |
199 | if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type)) |
209 | { |
200 | { |
210 | char *buf = (char *) malloc (strlen (oldmessage == NULL ? message : oldmessage) + 1); |
201 | char *buf = (char *) malloc (strlen (oldmessage == NULL ? message : oldmessage) + 1); |
… | |
… | |
227 | draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) |
218 | draw_ext_info_format (int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *old_format, char *new_format, ...) |
228 | { |
219 | { |
229 | char buf[HUGE_BUF]; |
220 | char buf[HUGE_BUF]; |
230 | |
221 | |
231 | if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) |
222 | if (!pl || (pl->type != PLAYER) || (pl->contr == NULL)) |
232 | return; |
|
|
233 | |
|
|
234 | if (pri >= pl->contr->listening) |
|
|
235 | return; |
223 | return; |
236 | |
224 | |
237 | if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type)) |
225 | if (!CLIENT_SUPPORT_READABLES (pl->contr->ns, type)) |
238 | { |
226 | { |
239 | va_list ap; |
227 | va_list ap; |