mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Fix build
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
|
@@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user