From 3bbfee0e1ca31b2ece778c9dd1a59d4ee21c2250 Mon Sep 17 00:00:00 2001
From: Ivan Savenko <saven.ivan@gmail.com>
Date: Fri, 31 Jan 2025 11:41:44 +0000
Subject: [PATCH] Fix usage of std::bitset

---
 lib/battle/BattleHexArray.cpp | 4 +---
 lib/battle/BattleHexArray.h   | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/battle/BattleHexArray.cpp b/lib/battle/BattleHexArray.cpp
index bbe95051f..12a8d3857 100644
--- a/lib/battle/BattleHexArray.cpp
+++ b/lib/battle/BattleHexArray.cpp
@@ -32,9 +32,7 @@ void BattleHexArray::insert(const BattleHexArray & other) noexcept
 
 void BattleHexArray::clear() noexcept
 {
-	for(const auto & hex : internalStorage)
-		presenceFlags[hex.toInt()] = false;
-
+	presenceFlags = {};
 	internalStorage.clear();
 }
 
diff --git a/lib/battle/BattleHexArray.h b/lib/battle/BattleHexArray.h
index fa5c70e9f..cbad8602d 100644
--- a/lib/battle/BattleHexArray.h
+++ b/lib/battle/BattleHexArray.h
@@ -126,7 +126,7 @@ public:
 		// reinit presence flags
 		presenceFlags = {};
 		for(const auto & hex : internalStorage)
-			presenceFlags.set(hex.toInt()) = true;
+			presenceFlags.set(hex.toInt());
 	}
 
 	void shuffle(vstd::RNG & rand)
@@ -239,7 +239,7 @@ public:
 		if(!s.saving)
 		{
 			for(const auto & hex : internalStorage)
-				presenceFlags.set(hex.toInt()) = true;
+				presenceFlags.set(hex.toInt());
 		}
 	}