mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Random template format change:
Tempaltes now can have optional "name" parameter for different names than identifier.
This commit is contained in:
parent
201ed26795
commit
cfacd1adc3
@ -39,8 +39,11 @@ void CRmgTemplateStorage::loadObject(std::string scope, std::string name, const
|
||||
auto tpl = new CRmgTemplate();
|
||||
try
|
||||
{
|
||||
tpl->setName(name); //TODO?
|
||||
const auto & templateNode = data;
|
||||
if (!templateNode["name"].isNull())
|
||||
tpl->setName(templateNode["name"].String()); //name can be customised. Allow duplicated names for different template versions.
|
||||
else
|
||||
tpl->setName(name); //identifier becomes default name
|
||||
|
||||
// Parse main template data
|
||||
tpl->setMinSize(parseMapTemplateSize(templateNode["minSize"].String()));
|
||||
|
Loading…
Reference in New Issue
Block a user