Fix some promotion bugs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 15 Jun 2014 17:53:45 +0000 (19:53 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 15 Jun 2014 17:53:45 +0000 (19:53 +0200)
Board.pm

index e6c04a3..d6a0f55 100644 (file)
--- a/Board.pm
+++ b/Board.pm
@@ -108,13 +108,12 @@ sub make_move {
                                        $nb->[$to_row + 1][$to_col] = '-';
                                }
                        }
-               } else {
-                       if (defined($promo) && $promo ne '') {
-                               if ($piece eq 'p') {
-                                       $piece = $promo;
-                               } else {
-                                       $piece = uc($promo);
-                               }
+               }
+               if (defined($promo) && $promo ne '') {
+                       if ($piece eq 'p') {
+                               $piece = lc($promo);
+                       } else {
+                               $piece = uc($promo);
                        }
                }
        }