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

Map objects now use shared_ptr (game)

This commit is contained in:
Ivan Savenko
2025-03-13 19:42:18 +00:00
parent 2ca1748e96
commit 0ada2a5ebd
49 changed files with 487 additions and 613 deletions

View File

@ -948,10 +948,10 @@ void CGMagi::onHeroVisit(const CGHeroInstance * h) const
std::vector<const CGObjectInstance *> eyes;
for (auto object : cb->gameState()->getMap().objects)
for (const auto & object : cb->gameState()->getMap().objects)
{
if (object && object->ID == Obj::EYE_OF_MAGI && object->subID == this->subID)
eyes.push_back(object);
eyes.push_back(object.get());
}
if (!eyes.empty())