From 9502c2c201543e028ea33c7a568f4ebe456c96d5 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Tue, 16 Sep 2025 02:58:41 +0200 Subject: [PATCH] fix --- lib/ResourceSet.cpp | 6 +++++- lib/ResourceSet.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ResourceSet.cpp b/lib/ResourceSet.cpp index f47625df3..728d81b61 100644 --- a/lib/ResourceSet.cpp +++ b/lib/ResourceSet.cpp @@ -18,7 +18,11 @@ VCMI_LIB_NAMESPACE_BEGIN -ResourceSet::ResourceSet() = default; +ResourceSet::ResourceSet() +{ + for(int i = 0; i < GameConstants::RESOURCE_QUANTITY; i++) + container[i] = 0; +} ResourceSet::ResourceSet(const JsonNode & node) { diff --git a/lib/ResourceSet.h b/lib/ResourceSet.h index 72162c7ff..534b8eefe 100644 --- a/lib/ResourceSet.h +++ b/lib/ResourceSet.h @@ -45,7 +45,7 @@ public: #define vectorOperator(OPSIGN) \ ResourceSet& operator OPSIGN ## =(const ResourceSet &rhs) \ { \ - for(auto i = 0; i < container.size(); i++) \ + for(auto i = 0; i < rhs.size(); i++) \ container[GameResID(i)] OPSIGN ## = rhs[i]; \ \ return *this; \