smol fixes

This commit is contained in:
Quinten Kock 2020-06-16 04:52:19 +02:00
parent 3702bddfd3
commit cc20fa0ce5
2 changed files with 8 additions and 2 deletions

View File

@ -149,7 +149,8 @@ void Board::make(Move m) {
// handle enpassant capture
if(
field[PTR_ENPASSANT] && piece_type == W_PAWN &&
field[PTR_ENPASSANT] &&
piece_type == W_PAWN &&
(m.sq_to & 0x7) == (field[PTR_ENPASSANT] & 0x7) &&
(m.sq_to & 0x70) == (0x50 - 0x30*black_moving())
) {
@ -165,7 +166,7 @@ void Board::make(Move m) {
// handle enpassant setup (double pawn move)
if(
piece_type == W_PAWN &&
(sq_diff == 32 || sq_diff == -32)
(sq_diff_abs == 32)
) {
// we are doing a pawn double-move.
// therefore, it allows enpassant in the next move.

View File

@ -1,3 +1,6 @@
#ifndef __PANIC_H_INC
#define __PANIC_H_INC
void panic(const __FlashStringHelper* message) {
while(true) {
Serial.println(F("PANIC!"));
@ -5,3 +8,5 @@ void panic(const __FlashStringHelper* message) {
delay(1000);
}
}
#endif