1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Fix issues reported by Sonar, review fixes

This commit is contained in:
Ivan Savenko
2025-04-21 18:41:01 +03:00
parent f3a57f754c
commit 4e8e85e3e4
26 changed files with 94 additions and 107 deletions

View File

@@ -1220,7 +1220,7 @@ public:
}
else if(bi.id >= BuildingID::MAGES_GUILD_1 && bi.id <= BuildingID::MAGES_GUILD_5)
{
evaluationContext.skillReward += 2 * buildThis.town->spellsAtLevel(bi.id.getMagesGuildLevel(), false);
evaluationContext.skillReward += 2 * bi.id.getMagesGuildLevel();
if (!alreadyOwn && evaluationContext.evaluator.ai->cb->canBuildStructure(buildThis.town, highestMageGuildPossible) != EBuildingState::FORBIDDEN)
{
for (auto hero : evaluationContext.evaluator.ai->cb->getHeroesInfo())

View File

@@ -52,7 +52,7 @@ namespace AIPathfinding
void QuestAction::execute(AIGateway * ai, const CGHeroInstance * hero) const
{
ai->moveHeroToTile(questInfo.getObject(cb)->visitablePos(), hero);
ai->moveHeroToTile(questInfo.getObject(ai->myCb.get())->visitablePos(), hero);
}
std::string QuestAction::toString() const