From 1a82280cb281d3fe8b12956f751c2bc9b554f281 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 5 Sep 2023 00:58:08 +0300 Subject: [PATCH] Fix build --- lib/constants/EntityIdentifiers.cpp | 2 ++ lib/rmg/CRmgTemplateStorage.cpp | 2 +- lib/rmg/CRmgTemplateStorage.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/constants/EntityIdentifiers.cpp b/lib/constants/EntityIdentifiers.cpp index a9a5513dd..7234190c9 100644 --- a/lib/constants/EntityIdentifiers.cpp +++ b/lib/constants/EntityIdentifiers.cpp @@ -224,6 +224,8 @@ bool PlayerColor::isSpectator() const std::string PlayerColor::toString() const { + if (num == -1) + return "neutral"; return encode(num); } diff --git a/lib/rmg/CRmgTemplateStorage.cpp b/lib/rmg/CRmgTemplateStorage.cpp index b8dfe8127..738d65c1a 100644 --- a/lib/rmg/CRmgTemplateStorage.cpp +++ b/lib/rmg/CRmgTemplateStorage.cpp @@ -39,7 +39,7 @@ void CRmgTemplateStorage::loadObject(std::string scope, std::string name, const { JsonDeserializer handler(nullptr, data); auto fullKey = scope + ":" + name; //actually it's not used - templates[fullKey] = std::make_unique(); + templates[fullKey] = std::make_shared(); templates[fullKey]->setId(fullKey); templates[fullKey]->serializeJson(handler); templates[fullKey]->setName(name); diff --git a/lib/rmg/CRmgTemplateStorage.h b/lib/rmg/CRmgTemplateStorage.h index 8a129dff1..6ce5c1411 100644 --- a/lib/rmg/CRmgTemplateStorage.h +++ b/lib/rmg/CRmgTemplateStorage.h @@ -37,7 +37,7 @@ public: std::vector getTemplates() const; private: - std::map> templates; + std::map> templates; };