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

Map objects now use shared_ptr (editor)

This commit is contained in:
Ivan Savenko
2025-03-13 19:42:57 +00:00
parent 0ada2a5ebd
commit dda5c9f13a
14 changed files with 45 additions and 54 deletions

View File

@@ -698,7 +698,7 @@ void MainWindow::addGroupIntoCatalog(const QString & groupName, bool useCustomNa
}
//create object to extract name
std::unique_ptr<CGObjectInstance> temporaryObj(factory->create(nullptr, templ));
auto temporaryObj(factory->create(nullptr, templ));
QString translated = useCustomName ? QString::fromStdString(temporaryObj->getObjectName().c_str()) : subGroupName;
itemType->setText(translated);
@@ -1401,8 +1401,8 @@ void MainWindow::on_actionLock_triggered()
{
for(auto obj : controller.map()->objects)
{
controller.scene(mapLevel)->selectionObjectsView.setLockObject(obj, true);
controller.scene(mapLevel)->objectsView.setLockObject(obj, true);
controller.scene(mapLevel)->selectionObjectsView.setLockObject(obj.get(), true);
controller.scene(mapLevel)->objectsView.setLockObject(obj.get(), true);
}
}
else