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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user