1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-22 00:27:58 +02:00

Merge branch 'master' into 'develop'

This commit is contained in:
Ivan Savenko
2024-01-25 16:23:13 +02:00
26 changed files with 152 additions and 155 deletions

View File

@@ -1075,14 +1075,14 @@ void CMapLoaderJson::MapObjectLoader::construct()
auto handler = VLC->objtypeh->getHandlerFor( ModScope::scopeMap(), typeName, subtypeName);
auto * appearance = new ObjectTemplate;
auto appearance = std::make_shared<ObjectTemplate>();
appearance->id = Obj(handler->getIndex());
appearance->subid = handler->getSubIndex();
appearance->readJson(configuration["template"], false);
// Will be destroyed soon and replaced with shared template
instance = handler->create(owner->map->cb, std::shared_ptr<const ObjectTemplate>(appearance));
instance = handler->create(owner->map->cb, appearance);
instance->id = ObjectInstanceID(static_cast<si32>(owner->map->objects.size()));
instance->instanceName = jsonKey;