Subversion Repositories Games.Chess Giants

Rev

Rev 150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 150 Rev 171
Line 286... Line 286...
286
      {
286
      {
287
         // if there's a move pending, validate it
287
         // if there's a move pending, validate it
288
         if ((new_move.source[0] != -1) && (new_move.source[1] != -1) && (new_move.target[0] != -1) && (new_move.target[1] != -1))
288
         if ((new_move.source[0] != -1) && (new_move.source[1] != -1) && (new_move.target[0] != -1) && (new_move.target[1] != -1))
289
         {
289
         {
290
            Board_AppendMove (board, new_move.source[0], new_move.source[1], new_move.target[0], new_move.target[1], new_move.promotion_type, pgn_comment); // save move
290
            Board_AppendMove (board, new_move.source[0], new_move.source[1], new_move.target[0], new_move.target[1], new_move.promotion_type, pgn_comment); // save move
291
            board->has_playerchanged = true; // switch players
-
 
292
            new_move.part = PART_NONE;
291
            new_move.part = PART_NONE;
293
            new_move.source[0] = -1;
292
            new_move.source[0] = -1;
294
            new_move.source[1] = -1;
293
            new_move.source[1] = -1;
295
            new_move.target[0] = -1;
294
            new_move.target[0] = -1;
296
            new_move.target[1] = -1;
295
            new_move.target[1] = -1;
Line 316... Line 315...
316
               board->game_state = STATE_BLACKWIN_CHECKMATE; // game was won by black on a checkmate (checkmate = check + stalemate)
315
               board->game_state = STATE_BLACKWIN_CHECKMATE; // game was won by black on a checkmate (checkmate = check + stalemate)
317
            else
316
            else
318
               board->game_state = STATE_BLACKWIN_RESIGNORFORFEIT; // game was won by black for another reason
317
               board->game_state = STATE_BLACKWIN_RESIGNORFORFEIT; // game was won by black for another reason
319
         }
318
         }
320
 
319
 
-
 
320
         board->players[1 - board->moves[board->move_count - 1].color].should_wakeup = true; // wake the player whose turn it is
321
         break; // we've finished reading the game
321
         break; // we've finished reading the game
322
      }
322
      }
323
 
323
 
324
      // else it must be a move data
324
      // else it must be a move data
325
      else
325
      else
326
      {
326
      {
327
         // if there's a move pending, validate it
327
         // if there's a move pending, validate it
328
         if ((new_move.source[0] != -1) && (new_move.source[1] != -1) && (new_move.target[0] != -1) && (new_move.target[1] != -1))
328
         if ((new_move.source[0] != -1) && (new_move.source[1] != -1) && (new_move.target[0] != -1) && (new_move.target[1] != -1))
329
         {
329
         {
330
            Board_AppendMove (board, new_move.source[0], new_move.source[1], new_move.target[0], new_move.target[1], new_move.promotion_type, pgn_comment); // save move
330
            Board_AppendMove (board, new_move.source[0], new_move.source[1], new_move.target[0], new_move.target[1], new_move.promotion_type, pgn_comment); // save move
331
            board->has_playerchanged = true; // switch players
-
 
332
            new_move.part = PART_NONE;
331
            new_move.part = PART_NONE;
333
            new_move.source[0] = -1;
332
            new_move.source[0] = -1;
334
            new_move.source[1] = -1;
333
            new_move.source[1] = -1;
335
            new_move.target[0] = -1;
334
            new_move.target[0] = -1;
336
            new_move.target[1] = -1;
335
            new_move.target[1] = -1;