X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmove.cpp;h=060e206bfd36a3e2bc081eca2242074da2e3a594;hb=53ccba8457231677897f531ff283136edc550cf2;hp=0a620781ce1be0a85eb9929bbf60691b504a7f42;hpb=b21a5e2f0638a55daeaa98ba95afc6c016ea0b6e;p=stockfish diff --git a/src/move.cpp b/src/move.cpp index 0a620781..060e206b 100644 --- a/src/move.cpp +++ b/src/move.cpp @@ -71,12 +71,9 @@ const string move_to_uci(Move m, bool chess960) { Move move_from_uci(const Position& pos, const string& str) { - MoveStack mlist[MAX_MOVES]; - MoveStack* last = generate(pos, mlist); - - for (MoveStack* cur = mlist; cur != last; cur++) - if (str == move_to_uci(cur->move, pos.is_chess960())) - return cur->move; + for (MoveList ml(pos); !ml.end(); ++ml) + if (str == move_to_uci(ml.move(), pos.is_chess960())) + return ml.move(); return MOVE_NONE; } @@ -95,7 +92,7 @@ const string move_to_san(Position& pos, Move m) { bool ambiguousMove, ambiguousFile, ambiguousRank; Square sq, from = move_from(m); Square to = move_to(m); - PieceType pt = pos.type_of_piece_on(from); + PieceType pt = piece_type(pos.piece_on(from)); string san; if (m == MOVE_NONE)