Nicolas Winkler 7 vuotta sitten
vanhempi
commit
d95a596d2c
2 muutettua tiedostoa jossa 3 lisäystä ja 4 poistoa
  1. 1 4
      src/BitBoard.h
  2. 2 0
      src/MoveGeneration.cpp

+ 1 - 4
src/BitBoard.h

@@ -62,10 +62,7 @@ struct chessy::Index
     inline int getColumn    (void) const    { return index & 0x7; }
     inline int getRow       (void) const    { return (index >> 3) & 0x7; }
 
-    inline std::string getName(void) const
-    {
-        return { char('a' + getColumn()), char(getRow() + '1') };
-    }
+    std::string getName(void) const;
 };
 
 

+ 2 - 0
src/MoveGeneration.cpp

@@ -405,6 +405,8 @@ void chessy::generateAllMoves(const ChessGame& cg, std::vector<Move>& moves)
 template<Side side>
 void chessy::orderMoves(const ChessGame& cg, std::vector<Move>& moves)
 {
+    if (moves.empty())
+        return;
     auto a = moves.begin();
     auto b = moves.end() - 1;
     Bitboard enemies = cg.getBoard().get<otherSide(side)>();