Browse Source

Fix build

Ivan Savenko 2 years ago
parent
commit
1a82280cb2

+ 2 - 0
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);
 }
 

+ 1 - 1
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<CRmgTemplate>();
+		templates[fullKey] = std::make_shared<CRmgTemplate>();
 		templates[fullKey]->setId(fullKey);
 		templates[fullKey]->serializeJson(handler);
 		templates[fullKey]->setName(name);

+ 1 - 1
lib/rmg/CRmgTemplateStorage.h

@@ -37,7 +37,7 @@ public:
 	std::vector<const CRmgTemplate *> getTemplates() const;
 
 private:
-	std::map<std::string, std::unique_ptr<CRmgTemplate>> templates;
+	std::map<std::string, std::shared_ptr<CRmgTemplate>> templates;
 };