Fix zippy handling of draw offers from ICS
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 1 Aug 2010 11:27:23 +0000 (13:27 +0200)
committerArun Persaud <arun@nubati.net>
Mon, 2 Aug 2010 07:58:37 +0000 (00:58 -0700)
The patch by DM to fix the problem introduced by the coloration of
zippy-matched commands (namely that the coloration code beat the zippy
draw recognition to it, and ate the draw offer away) was only targeting
ICC. The new fix should work on any ICS (by using the same pattern in
zippy as in the colorization code).

zippy.c

diff --git a/zippy.c b/zippy.c
index 9df805a..ef1b505 100644 (file)
--- a/zippy.c
+++ b/zippy.c
@@ -931,20 +931,13 @@ int ZippyMatch(buf, i)
     }
 
 
-    if (ics_type == ICS_ICC) { // [DM]
-        if (looking_at(buf, i, "Your opponent offers you a draw")) {
-            if (first.sendDrawOffers && first.initDone)
-                SendToProgram("draw\n", &first);
-            return TRUE;
-        }
-    } else {
-        if (looking_at(buf, i, "offers you a draw")) {
+        if (looking_at(buf, i, "Your opponent offers you a draw") ||
+            looking_at(buf, i, "* offers you a draw")) {
             if (first.sendDrawOffers && first.initDone) {
                 SendToProgram("draw\n", &first);
             }
             return TRUE;
         }
-    }
 
     if (looking_at(buf, i, "requests that the game be aborted") ||
         looking_at(buf, i, "would like to abort")) {