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

Fix some issues detected by Sonar & code review, fix build

This commit is contained in:
Ivan Savenko
2025-04-01 19:11:12 +03:00
parent 586620a290
commit 93b18ee94b
34 changed files with 86 additions and 128 deletions

View File

@@ -120,10 +120,9 @@ void MapController::repairMap(CMap * map)
for(auto obj : allImpactedObjects)
{
//fix flags
if(obj->getOwner() == PlayerColor::UNFLAGGABLE)
if(obj->asOwnable() != nullptr && obj->getOwner() == PlayerColor::UNFLAGGABLE)
{
if(obj->asOwnable())
obj->tempOwner = PlayerColor::NEUTRAL;
obj->tempOwner = PlayerColor::NEUTRAL;
}
//fix hero instance
if(auto * nih = dynamic_cast<CGHeroInstance*>(obj))