Fix printing non-numeric kibitz with -autoKibitz
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 15 Jan 2012 20:24:12 +0000 (21:24 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Mon, 16 Jan 2012 13:58:14 +0000 (14:58 +0100)
Messages that were not considered kibitzed engine PV info for lack of
numeric content, were kibitzed as coming from "your opponent", which
is nonsense if you were iobserving, and masked the source. Fortunately
star_match[0] is still holding the original name, at that point.

backend.c

index f2aae99..6d0708d 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -2929,6 +2929,9 @@ read_from_ics (InputSourceRef isr, VOIDSTAR closure, char *data, int count, int
                            OutputKibitz(suppressKibitz, parse);
                        } else {
                            char tmp[MSG_SIZ];
+                           if(gameMode == IcsObserving) // restore original ICS messages
+                             snprintf(tmp, MSG_SIZ, "%s kibitzes: %s", star_match[0], parse);
+                           else
                            snprintf(tmp, MSG_SIZ, _("your opponent kibitzes: %s"), parse);
                            SendToPlayer(tmp, strlen(tmp));
                        }