[Tkabber-dev] r1486 - trunk/tkabber-plugins/chess

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Aug 8 20:31:36 MSD 2008


Author: sergei
Date: 2008-08-08 20:31:36 +0400 (Fri, 08 Aug 2008)
New Revision: 1486

Modified:
   trunk/tkabber-plugins/chess/chess.tcl
Log:
	* Fixed bug in adding en passant to position code.


Modified: trunk/tkabber-plugins/chess/chess.tcl
===================================================================
--- trunk/tkabber-plugins/chess/chess.tcl	2008-08-08 15:47:17 UTC (rev 1485)
+++ trunk/tkabber-plugins/chess/chess.tcl	2008-08-08 16:31:36 UTC (rev 1486)
@@ -353,11 +353,13 @@
 	set cp1 [expr {$c + 1}]
 	set cm1 [expr {$c - 1}]
 	if {$r == 2} {
-	    if {$flags(position,$cp1,3) == "bp" || $flags(position,$cm1,3) == "bp"} {
+	    if {($cp1 < 8 && $flags(position,$cp1,3) == "bp") || \
+		    ($cm1 >= 0 && $flags(position,$cm1,3) == "bp")} {
 		append code $c$r
 	    }
 	} elseif {$r == 5} {
-	    if {$flags(position,$cp1,4) == "wp" || $flags(position,$cm1,4) == "wp"} {
+	    if {($cp1 < 8 && $flags(position,$cp1,4) == "wp") || \
+		    ($cm1 >= 0 && $flags(position,$cm1,4) == "wp")} {
 		append code $c$r
 	    }
 	}



More information about the Tkabber-dev mailing list