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
|
@ -584,9 +584,9 @@ Bool MoveDo(GameState *state, I64 piece_num, I64 x2, I64 y2, Bool final)
|
||||||
game_over = TRUE;
|
game_over = TRUE;
|
||||||
}
|
}
|
||||||
GameSnapShot;
|
GameSnapShot;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ToBool(score_adjust);
|
return ToBool(score_adjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 MoveFind(I64 x, I64 y, Move *mvs, I64 mv_cnt)
|
I64 MoveFind(I64 x, I64 y, Move *mvs, I64 mv_cnt)
|
||||||
|
@ -664,18 +664,25 @@ I64 MoveCnt(GameState *state)
|
||||||
{
|
{
|
||||||
I64 i, res = 0, mv_cnt;
|
I64 i, res = 0, mv_cnt;
|
||||||
Move mvs[32];
|
Move mvs[32];
|
||||||
|
Bool king_stalemate = TRUE;
|
||||||
|
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
|
{
|
||||||
if (state->pieces[i].player == state->cur_player)
|
if (state->pieces[i].player == state->cur_player)
|
||||||
{
|
{
|
||||||
mv_cnt = PieceMoves(state, i, mvs);
|
mv_cnt = PieceMoves(state, i, mvs);
|
||||||
mv_cnt = ChkPieceMoves(state, i, mvs,mv_cnt);
|
mv_cnt = ChkPieceMoves(state, i, mvs,mv_cnt);
|
||||||
res += mv_cnt;
|
res += mv_cnt;
|
||||||
}
|
}
|
||||||
return res;
|
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)
|
U0 DrawIt(CTask *task, CDC *dc)
|
||||||
{
|
{
|
||||||
I64 i, x, y, z, k0, k1;
|
I64 i, x, y, z, k0, k1;
|
||||||
|
|
Loading…
Reference in a new issue