mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Fix some issues detected by Sonar & code review, fix build
This commit is contained in:
@@ -185,29 +185,6 @@ TGoalVec CompleteQuest::missionKeymaster(const Nullkiller * ai) const
|
||||
TGoalVec CompleteQuest::missionResources(const Nullkiller * ai) const
|
||||
{
|
||||
TGoalVec solutions = tryCompleteQuest(ai);
|
||||
|
||||
/*auto heroes = cb->getHeroesInfo(); //TODO: choose best / free hero from among many possibilities?
|
||||
|
||||
if(heroes.size())
|
||||
{
|
||||
if(q.getQuest(cb)->checkQuest(heroes.front())) //it doesn't matter which hero it is
|
||||
{
|
||||
return solutions;// ai->ah->howToVisitObj(q.getObject(cb));
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < q.getQuest(cb)->m7resources.size(); ++i)
|
||||
{
|
||||
if(q.getQuest(cb)->m7resources[i])
|
||||
solutions.push_back(sptr(CollectRes(static_cast<EGameResID>(i), q.getQuest(cb)->m7resources[i])));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
solutions.push_back(sptr(Goals::RecruitHero())); //FIXME: checkQuest requires any hero belonging to player :(
|
||||
}*/
|
||||
|
||||
return solutions;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,10 @@ bool canBeEmbarkmentPoint(const TerrainTile * t, bool fromWater)
|
||||
bool isBlockedBorderGate(int3 tileToHit) //TODO: is that function needed? should be handled by pathfinder
|
||||
{
|
||||
const auto * object = cb->getTopObj(tileToHit);
|
||||
if( object && object->id != Obj::BORDER_GATE)
|
||||
if(!object)
|
||||
return false;
|
||||
|
||||
if(object->id != Obj::BORDER_GATE)
|
||||
return false;
|
||||
|
||||
auto gate = dynamic_cast<const CGKeys *>(object);
|
||||
|
||||
@@ -673,7 +673,7 @@ void VCAI::commanderGotLevel(const CCommanderInstance * commander, std::vector<u
|
||||
{
|
||||
LOG_TRACE_PARAMS(logAi, "queryID '%i'", queryID);
|
||||
NET_EVENT_HANDLER;
|
||||
status.addQuery(queryID, boost::str(boost::format("Commander %s of %s got level %d") % commander->name % commander->getArmy()->nodeName() % (int)commander->level));
|
||||
status.addQuery(queryID, boost::str(boost::format("Commander %s of %s got level %d") % commander->name % commander->getArmy()->nodeName() % static_cast<int>(commander->level)));
|
||||
executeActionAsync("commanderGotLevel", [this, queryID](){ answerQuery(queryID, 0); });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user