1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Fix build

This commit is contained in:
Ivan Savenko
2023-09-05 00:58:08 +03:00
parent 609f25f344
commit 1a82280cb2
3 changed files with 4 additions and 2 deletions

View File

@@ -224,6 +224,8 @@ bool PlayerColor::isSpectator() const
std::string PlayerColor::toString() const std::string PlayerColor::toString() const
{ {
if (num == -1)
return "neutral";
return encode(num); return encode(num);
} }

View File

@@ -39,7 +39,7 @@ void CRmgTemplateStorage::loadObject(std::string scope, std::string name, const
{ {
JsonDeserializer handler(nullptr, data); JsonDeserializer handler(nullptr, data);
auto fullKey = scope + ":" + name; //actually it's not used 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]->setId(fullKey);
templates[fullKey]->serializeJson(handler); templates[fullKey]->serializeJson(handler);
templates[fullKey]->setName(name); templates[fullKey]->setName(name);

View File

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