1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Objects list is now private member of CMap

This commit is contained in:
Ivan Savenko
2025-03-15 17:40:10 +00:00
parent 745040def3
commit bdae7285ae
22 changed files with 166 additions and 231 deletions

View File

@@ -587,8 +587,6 @@ CInsertObjectOperation::CInsertObjectOperation(CMap* map, std::shared_ptr<CGObje
void CInsertObjectOperation::execute()
{
obj->id = ObjectInstanceID(map->objects.size());
map->generateUniqueInstanceName(obj.get());
map->addNewObject(obj);
}
@@ -650,8 +648,6 @@ void CRemoveObjectOperation::execute()
void CRemoveObjectOperation::undo()
{
assert(removedObject != nullptr);
//set new id, but do not rename object
removedObject->id = ObjectInstanceID(static_cast<si32>(map->objects.size()));
map->addNewObject(removedObject);
}