From cc20fa0ce5630ad91ae48ed8c8ea0850e7b0f956 Mon Sep 17 00:00:00 2001 From: Quinten Kock Date: Tue, 16 Jun 2020 04:52:19 +0200 Subject: [PATCH] smol fixes --- Board.h | 5 +++-- Panic.h | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Board.h b/Board.h index ec5b816..71a5804 100644 --- a/Board.h +++ b/Board.h @@ -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. diff --git a/Panic.h b/Panic.h index 64b457b..664e1b9 100644 --- a/Panic.h +++ b/Panic.h @@ -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