From 688a2d8145364eb8ec0bec3169008d7b05a16ed7 Mon Sep 17 00:00:00 2001 From: lcw Date: Sat, 10 Feb 2024 23:59:38 +0800 Subject: [PATCH] fix a bug --- processor/logic/GameBoard.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processor/logic/GameBoard.cpp b/processor/logic/GameBoard.cpp index ad2c7f2..514e130 100644 --- a/processor/logic/GameBoard.cpp +++ b/processor/logic/GameBoard.cpp @@ -80,7 +80,8 @@ void GameBoard::turnUpdate() { tile.unit += 1; if (tile.type == TileType::Swamp) { - tile.unit -= 1; + if (tile.unit > 0) + tile.unit -= 1; if (tile.unit == 0) tile.owner = neutral_player; }