… | |
… | |
487 | } |
487 | } |
488 | |
488 | |
489 | void |
489 | void |
490 | client::send_msg (int color, const char *type, const char *msg) |
490 | client::send_msg (int color, const char *type, const char *msg) |
491 | { |
491 | { |
|
|
492 | if (!msg || !type) // it can happen (for example, missing attack messages cause this) |
|
|
493 | { |
|
|
494 | LOG (logBacktrace | llevError, "send_msg(%d,%p,%p) called with NULL msg or type.\n", color, type, msg); |
|
|
495 | return; |
|
|
496 | } |
|
|
497 | |
492 | if (msg_is_special (msg) || (type [0] == 'c' && type [1] == '/')) |
498 | if (msg_is_special (msg) || (type [0] == 'c' && type [1] == '/')) |
493 | cfperl_send_msg (this, color, type, msg); |
499 | cfperl_send_msg (this, color, type, msg); |
494 | else if (can_msg) |
500 | else if (can_msg) |
495 | send_packet_printf ("msg %d %s %s", color & NDI_CLIENT_MASK, type, msg); |
501 | send_packet_printf ("msg %d %s %s", color & NDI_CLIENT_MASK, type, msg); |
496 | else if (color < 0) |
502 | else if (color < 0) |