src/game.c

changeset 128
ce38ee9bc3af
parent 127
7258a46bf5ae
equal deleted inserted replaced
127:7258a46bf5ae 128:ce38ee9bc3af
251 } else if (strncmp(movestr, "remis", MOVESTR_BUFLEN) == 0) { 251 } else if (strncmp(movestr, "remis", MOVESTR_BUFLEN) == 0) {
252 gamestate->remis = true; 252 gamestate->remis = true;
253 return 1; 253 return 1;
254 } else if (strncmp(movestr, "savepgn", MOVESTR_BUFLEN) == 0) { 254 } else if (strncmp(movestr, "savepgn", MOVESTR_BUFLEN) == 0) {
255 save_pgn(gamestate, gameinfo); 255 save_pgn(gamestate, gameinfo);
256 } else if (movestr[0] == 0) {
257 /* ignore empty move strings and ask again */
256 } else { 258 } else {
257 Move move; 259 Move move;
258 int result = eval_move(gamestate, movestr, &move, curcolor); 260 int result = eval_move(gamestate, movestr, &move, curcolor);
259 if (result == VALID_MOVE_SYNTAX) { 261 if (result == VALID_MOVE_SYNTAX) {
260 result = validate_move(gamestate, &move); 262 result = validate_move(gamestate, &move);
385 return 1; 387 return 1;
386 } else { 388 } else {
387 remis_rejected = true; 389 remis_rejected = true;
388 } 390 }
389 } 391 }
392 } else if (movestr[0] == 0) {
393 /* ignore empty move strings and ask again */
390 } else { 394 } else {
391 Move move; 395 Move move;
392 int eval_result = eval_move(gamestate, movestr, &move, mycolor); 396 int eval_result = eval_move(gamestate, movestr, &move, mycolor);
393 switch (eval_result) { 397 switch (eval_result) {
394 case VALID_MOVE_SYNTAX: 398 case VALID_MOVE_SYNTAX:

mercurial