1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Restore previous removeObject

This commit is contained in:
Tomasz Zieliński
2024-04-03 22:17:36 +02:00
parent 12da0196a0
commit 9f048888dd

View File

@ -571,25 +571,21 @@ void CMap::removeObject(CGObjectInstance * obj)
removeBlockVisTiles(obj);
instanceNames.erase(obj->instanceName);
// FIXME: This is inefficient when bacth-deleting objects, as objects are updated one by one.
// FIXME: This is inefficient when batch-deleting objects, as objects are updated one by one.
//update indeces
/*
auto iter = std::next(objects.begin(), obj->id.getNum());
iter = objects.erase(iter);
for(int i = obj->id.getNum(); iter != objects.end(); ++i, ++iter)
{
(*iter)->id = ObjectInstanceID(i);
}
*/
// TODO: Check if it doesn't break here
reindexObjects();
obj->afterRemoveFromMap(this);
//TOOD: Clean artifact instances (mostly worn by hero?) and quests related to this object
//This causes crash with undo/redo in editor
}
bool CMap::isWaterMap() const