Fix uninitialized value when board has no King
It's possible for there to be no King if we're running unit tests rather than a real game.
This commit is contained in:
parent
50c3ae576b
commit
be01a9349d
1 changed files with 6 additions and 1 deletions
|
@ -624,10 +624,15 @@ public class ChessState : Object
|
|||
|
||||
rank = ranks;
|
||||
file = files;
|
||||
|
||||
return found;
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
/* There is no King. (Must be a test rather than a real game!) */
|
||||
rank = {};
|
||||
file = {};
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool is_in_check (ChessPlayer player)
|
||||
|
|
Loading…
Reference in a new issue