mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Switch ObjectTemplate to shared_ptr<const> (#870)
This commit is contained in:
committed by
Andrii Danylchenko
parent
cedc9a92ed
commit
3d2dc2335b
@@ -1110,13 +1110,14 @@ void CMapLoaderJson::MapObjectLoader::construct()
|
||||
|
||||
auto handler = VLC->objtypeh->getHandlerFor(typeName, subtypeName);
|
||||
|
||||
ObjectTemplate appearance;
|
||||
auto appearance = new ObjectTemplate;
|
||||
|
||||
appearance.id = Obj(handler->type);
|
||||
appearance.subid = handler->subtype;
|
||||
appearance.readJson(configuration["template"], false);
|
||||
appearance->id = Obj(handler->type);
|
||||
appearance->subid = handler->subtype;
|
||||
appearance->readJson(configuration["template"], false);
|
||||
|
||||
instance = handler->create(appearance);
|
||||
// Will be destroyed soon and replaced with shared template
|
||||
instance = handler->create(std::shared_ptr<const ObjectTemplate>(appearance));
|
||||
|
||||
instance->id = ObjectInstanceID((si32)owner->map->objects.size());
|
||||
instance->instanceName = jsonKey;
|
||||
|
||||
Reference in New Issue
Block a user