src/game.c

changeset 116
4bf18d42e7ee
parent 115
206201d544be
equal deleted inserted replaced
115:206201d544be 116:4bf18d42e7ee
340 printw("\nThe opponent sent an invalid network pacakge."); 340 printw("\nThe opponent sent an invalid network pacakge.");
341 } 341 }
342 342
343 /* read move */ 343 /* read move */
344 if (use_premove || asyncgetnstr(movestr, &bufpos, MOVESTR_BUFLEN)) { 344 if (use_premove || asyncgetnstr(movestr, &bufpos, MOVESTR_BUFLEN)) {
345 bool was_premove = use_premove;
345 use_premove = false; 346 use_premove = false;
346 if (strncmp(movestr, "resign", MOVESTR_BUFLEN) == 0) { 347 if (strncmp(movestr, "resign", MOVESTR_BUFLEN) == 0) {
347 gamestate->resign = 1; 348 gamestate->resign = 1;
348 printw("You resigned!"); 349 printw("You resigned!");
349 clrtoeol(); 350 clrtoeol();
418 } else { 419 } else {
419 printw("Invalid network response."); 420 printw("Invalid network response.");
420 } 421 }
421 break; 422 break;
422 default: 423 default:
423 eval_move_failed_msg(eval_result); 424 if (was_premove) {
425 printw("\nThe prepared move could not be executed.");
426 } else {
427 eval_move_failed_msg(eval_result);
428 }
424 } 429 }
425 clrtoeol(); 430 clrtoeol();
426 } 431 }
427 } 432 }
428 } 433 }

mercurial