shithub: moonfish

Download patch

ref: fb2cb4f53876b1b0c6060464e0dd5a05ab00e502
parent: c9ffb784db5f62453149c47facc7364993d7f704
author: zamfofex <zamfofex@twdb.moe>
date: Tue Mar 26 12:26:54 EDT 2024

apply small move generation fix

--- a/chess.c
+++ b/chess.c
@@ -241,11 +241,11 @@
 	
 	if (chess->board[from + dy] == moonfish_empty)
 	{
-		moonfish_move(chess, *moves, from, from + dy);
+		moonfish_move(chess, (*moves)++, from, from + dy);
 				
 		if (chess->white ? from < 40 : from > 80)
-			if (chess->board[from + dy * 2] == moonfish_empty)
-				moonfish_move(chess, (*moves)++, from, from + dy * 2);
+		if (chess->board[from + dy * 2] == moonfish_empty)
+			moonfish_move(chess, (*moves)++, from, from + dy * 2);
 	}
 	
 	moonfish_pawn_capture(chess, moves, from, from + dy + 1);
--