From bb30752226c59148ae36beb248c8e4ed6eac39d1 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 28 Jul 2026 10:42:53 +0200 Subject: again fixing memory bugs --- src/board.hpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/board.hpp') diff --git a/src/board.hpp b/src/board.hpp index 5e4e777..1c53827 100644 --- a/src/board.hpp +++ b/src/board.hpp @@ -23,27 +23,27 @@ enum GameState { std::string toChar(PieceType type, bool white); struct Piece { - bool color; - PieceType type; - bool moved; + bool color = 0; + PieceType type = NONE; + bool moved = false; }; struct Position { - uint8_t rank; - uint8_t file; + uint8_t rank = 0; + uint8_t file = 0; bool operator==(const Position &) const = default; }; struct Game { Piece pieces[64]; - bool turn; // 1 white; 0 black - std::string castle; - uint8_t halfMoveClock; - uint16_t MoveClock; + bool turn = 1; // 1 white; 0 black + std::string castle = ""; + uint8_t halfMoveClock = 0; + uint16_t MoveClock = 0; Position enPassant; - bool canEnpassant; - GameState state; + bool canEnpassant = 0; + GameState state = TURN; }; struct Move { -- cgit v1.2.3