1 | /* |
1 | /* |
2 | * static char *rcsid_sock_info_c = |
2 | * static char *rcsid_sock_info_c = |
3 | * "$Id: info.C,v 1.3 2006/08/31 17:54:15 root Exp $"; |
3 | * "$Id: info.C,v 1.4 2006/09/03 00:18:43 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
115 | { |
115 | { |
116 | char tbuf[MAX_BUF]; |
116 | char tbuf[MAX_BUF]; |
117 | |
117 | |
118 | if (outputs->buf==NULL) return; |
118 | if (outputs->buf==NULL) return; |
119 | if (outputs->count > 1) { |
119 | if (outputs->count > 1) { |
120 | snprintf(tbuf,MAX_BUF, "%d times %s", outputs->count, outputs->buf); |
120 | snprintf(tbuf,MAX_BUF, "%d times %s", outputs->count, &outputs->buf); |
121 | print_message(NDI_BLACK, pl, tbuf); |
121 | print_message(NDI_BLACK, pl, tbuf); |
122 | } else |
122 | } else |
123 | print_message(NDI_BLACK, pl, outputs->buf); |
123 | print_message(NDI_BLACK, pl, &outputs->buf); |
124 | |
124 | |
125 | free_string(outputs->buf); |
|
|
126 | outputs->buf=NULL; |
125 | outputs->buf=NULL; |
127 | outputs->first_update=0; /* This way, it will be reused */ |
126 | outputs->first_update=0; /* This way, it will be reused */ |
128 | } |
127 | } |
129 | |
128 | |
130 | /** |
129 | /** |
… | |
… | |
169 | else { |
168 | else { |
170 | flush_output_element(pl, &pl->contr->outputs[oldest]); |
169 | flush_output_element(pl, &pl->contr->outputs[oldest]); |
171 | |
170 | |
172 | pl->contr->outputs[oldest].first_update = pticks; |
171 | pl->contr->outputs[oldest].first_update = pticks; |
173 | pl->contr->outputs[oldest].count = 1; |
172 | pl->contr->outputs[oldest].count = 1; |
174 | if (pl->contr->outputs[oldest].buf!=NULL) |
|
|
175 | free_string(pl->contr->outputs[oldest].buf); |
|
|
176 | pl->contr->outputs[oldest].buf = add_string(buf); |
173 | pl->contr->outputs[oldest].buf = buf; |
177 | } |
174 | } |
178 | } |
175 | } |
179 | } |
176 | } |
180 | |
177 | |
181 | |
178 | |
… | |
… | |
391 | (const char *)pl->spell->name); |
388 | (const char *)pl->spell->name); |
392 | else |
389 | else |
393 | sprintf(obuf,"Range: Casting spell (%s)", |
390 | sprintf(obuf,"Range: Casting spell (%s)", |
394 | (const char *)pl->spell->name); |
391 | (const char *)pl->spell->name); |
395 | } else |
392 | } else |
396 | sprintf(obuf,"Range: spell (%s)", |
393 | sprintf(obuf,"Range: spell (%s)", &pl->contr->ranges[range_magic]->name); |
397 | pl->contr->ranges[range_magic]->name); |
|
|
398 | } else |
394 | } else |
399 | sprintf(obuf,"Range: spell (%s)", |
395 | sprintf(obuf,"Range: spell (%s)", &pl->contr->ranges[range_magic]->name); |
400 | pl->contr->ranges[range_magic]->name); |
|
|
401 | break; |
396 | break; |
402 | |
397 | |
403 | case range_misc: |
398 | case range_misc: |
404 | sprintf(obuf,"Range: %s", |
399 | sprintf(obuf,"Range: %s", pl->contr->ranges[range_misc] ? |
405 | pl->contr->ranges[range_misc]? |
|
|
406 | query_base_name(pl->contr->ranges[range_misc],0): "none"); |
400 | query_base_name(pl->contr->ranges[range_misc],0) : "none"); |
407 | break; |
401 | break; |
408 | |
402 | |
409 | /* range_scroll is only used for controlling golems. If the |
403 | /* range_scroll is only used for controlling golems. If the |
410 | * the player does not have a golem, reset some things. |
404 | * the player does not have a golem, reset some things. |
411 | */ |
405 | */ |
412 | case range_golem: |
406 | case range_golem: |
413 | if (pl->contr->ranges[range_golem]!=NULL) |
407 | if (pl->contr->ranges[range_golem]!=NULL) |
414 | sprintf(obuf,"Range: golem (%s)",pl->contr->ranges[range_golem]->name); |
408 | sprintf(obuf,"Range: golem (%s)", &pl->contr->ranges[range_golem]->name); |
415 | else { |
409 | else { |
416 | pl->contr->shoottype = range_none; |
410 | pl->contr->shoottype = range_none; |
417 | strcpy(obuf,"Range: nothing"); |
411 | strcpy(obuf,"Range: nothing"); |
418 | } |
412 | } |
419 | break; |
413 | break; |