Fix oblique multi-leg moves in XBetza
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 31 May 2020 17:22:29 +0000 (19:22 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 31 May 2020 18:32:37 +0000 (20:32 +0200)
Continuation legs of oblique atoms have thei directional modifiers
interpreted in the K system. But this had as an intended side effect
that they were split into a diagonal and orthogonal atom for separate
treatment, which for obliques is of course not possible, nor needed.
So this code is bypassed for the obliques now.

moves.c

diff --git a/moves.c b/moves.c
index da1aa13..f0fa2db 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -387,6 +387,7 @@ MovesFromString (Board board, int flags, int f, int r, int tx, int ty, int angle
                    if(!dirSet) dirSet = (tx < 0 ? 0xFF                     // default is all directions, but in continuation leg
                                          : all == 0xFF ? 0xEF : 0x45);     // omits backward, and for 4-fold atoms also diags
                    dirSet = (dirSet << angle | dirSet >> 8-angle) & 255;   // re-orient direction system
+                   if(dx && dx != dy) break;     // oblique continuation
                    ds2 = dirSet & 0xAA;          // extract diagonal directions
                    if(dirSet &= 0x55)            // start with orthogonal moves, if present
                         retry = 1, dx = 0;       // and schedule the diagonal moves for later