1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +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

@@ -90,13 +90,9 @@ std::set<Validator::Issue> Validator::validate(const CMap * map)
//owners for objects
if(o->getOwner() == PlayerColor::UNFLAGGABLE)
{
if(dynamic_cast<CGMine *>(o.get()) ||
dynamic_cast<CGDwelling *>(o.get()) ||
dynamic_cast<CGTownInstance *>(o.get()) ||
dynamic_cast<CGGarrison *>(o.get()) ||
dynamic_cast<CGHeroInstance *>(o.get()))
if(o->asOwnable())
{
issues.insert({ tr("Armored instance %1 is UNFLAGGABLE but must have NEUTRAL or player owner").arg(o->instanceName.c_str()), true });
issues.insert({ tr("Ownable object %1 is UNFLAGGABLE but must have NEUTRAL or player owner").arg(o->instanceName.c_str()), true });
}
}
if(o->getOwner() != PlayerColor::NEUTRAL && o->getOwner().getNum() < map->players.size())