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

@@ -52,13 +52,14 @@ MapObjectVisitQuery::MapObjectVisitQuery(CGameHandler * owner, const CGObjectIns
void MapObjectVisitQuery::onRemoval(PlayerColor color)
{
auto object = gh->gameState()->getObjInstance(visitedObject);
auto hero = gh->gameState()->getHero(visitingHero);
gh->objectVisitEnded(hero, players.front());
//Can object visit affect 2 players and what would be desired behavior?
if(removeObjectAfterVisit)
gh->removeObject(hero, color);
gh->removeObject(object, color);
}
TownBuildingVisitQuery::TownBuildingVisitQuery(CGameHandler * owner, const CGTownInstance * Obj, std::vector<const CGHeroInstance *> heroes, std::vector<BuildingID> buildingToVisit)