mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Two kings ends game
This commit is contained in:
parent
451fddb9eb
commit
d26f67edf1
1 changed files with 11 additions and 4 deletions
|
@ -664,18 +664,25 @@ I64 MoveCnt(GameState *state)
|
|||
{
|
||||
I64 i, res = 0, mv_cnt;
|
||||
Move mvs[32];
|
||||
Bool king_stalemate = TRUE;
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
if (state->pieces[i].player == state->cur_player)
|
||||
{
|
||||
mv_cnt = PieceMoves(state, i, mvs);
|
||||
mv_cnt = ChkPieceMoves(state, i, mvs,mv_cnt);
|
||||
res += mv_cnt;
|
||||
}
|
||||
if (state->pieces[i].type != P_KING && state->pieces[i].player >= 0)
|
||||
king_stalemate = FALSE;
|
||||
}
|
||||
if (king_stalemate)
|
||||
return 0;
|
||||
else
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
U0 DrawIt(CTask *task, CDC *dc)
|
||||
{
|
||||
I64 i, x, y, z, k0, k1;
|
||||
|
|
Loading…
Reference in a new issue