mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Merge pull request #2957 from ProjectMutilation/fix-pvs-issues
Fixed some issues found by pvs
This commit is contained in:
@@ -702,8 +702,8 @@ void AIGateway::showGarrisonDialog(const CArmedInstance * up, const CGHeroInstan
|
|||||||
LOG_TRACE_PARAMS(logAi, "removableUnits '%i', queryID '%i'", removableUnits % queryID);
|
LOG_TRACE_PARAMS(logAi, "removableUnits '%i', queryID '%i'", removableUnits % queryID);
|
||||||
NET_EVENT_HANDLER;
|
NET_EVENT_HANDLER;
|
||||||
|
|
||||||
std::string s1 = up ? up->nodeName() : "NONE";
|
std::string s1 = up->nodeName();
|
||||||
std::string s2 = down ? down->nodeName() : "NONE";
|
std::string s2 = down->nodeName();
|
||||||
|
|
||||||
status.addQuery(queryID, boost::str(boost::format("Garrison dialog with %s and %s") % s1 % s2));
|
status.addQuery(queryID, boost::str(boost::format("Garrison dialog with %s and %s") % s1 % s2));
|
||||||
|
|
||||||
@@ -711,7 +711,9 @@ void AIGateway::showGarrisonDialog(const CArmedInstance * up, const CGHeroInstan
|
|||||||
requestActionASAP([=]()
|
requestActionASAP([=]()
|
||||||
{
|
{
|
||||||
if(removableUnits && up->tempOwner == down->tempOwner)
|
if(removableUnits && up->tempOwner == down->tempOwner)
|
||||||
|
{
|
||||||
pickBestCreatures(down, up);
|
pickBestCreatures(down, up);
|
||||||
|
}
|
||||||
|
|
||||||
answerQuery(queryID, 0);
|
answerQuery(queryID, 0);
|
||||||
});
|
});
|
||||||
|
@@ -60,14 +60,11 @@ TGoalVec CollectRes::getAllPossibleSubgoals()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Obj::WATER_WHEEL:
|
|
||||||
if (resID != GameResID(EGameResID::GOLD))
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case Obj::MYSTICAL_GARDEN:
|
case Obj::MYSTICAL_GARDEN:
|
||||||
if ((resID != GameResID(EGameResID::GOLD)) && (resID != GameResID(EGameResID::GEMS)))
|
if ((resID != GameResID(EGameResID::GOLD)) && (resID != GameResID(EGameResID::GEMS)))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
case Obj::WATER_WHEEL:
|
||||||
case Obj::LEAN_TO:
|
case Obj::LEAN_TO:
|
||||||
case Obj::WAGON:
|
case Obj::WAGON:
|
||||||
if (resID != GameResID(EGameResID::GOLD))
|
if (resID != GameResID(EGameResID::GOLD))
|
||||||
|
@@ -138,7 +138,7 @@ ColorFilter ColorFilter::genFromJson(const JsonNode & entry)
|
|||||||
r.a = entry["red"].Vector()[3].Float();
|
r.a = entry["red"].Vector()[3].Float();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entry["red"].isNull())
|
if (!entry["green"].isNull())
|
||||||
{
|
{
|
||||||
g.r = entry["green"].Vector()[0].Float();
|
g.r = entry["green"].Vector()[0].Float();
|
||||||
g.g = entry["green"].Vector()[1].Float();
|
g.g = entry["green"].Vector()[1].Float();
|
||||||
@@ -146,7 +146,7 @@ ColorFilter ColorFilter::genFromJson(const JsonNode & entry)
|
|||||||
g.a = entry["green"].Vector()[3].Float();
|
g.a = entry["green"].Vector()[3].Float();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!entry["red"].isNull())
|
if (!entry["blue"].isNull())
|
||||||
{
|
{
|
||||||
b.r = entry["blue"].Vector()[0].Float();
|
b.r = entry["blue"].Vector()[0].Float();
|
||||||
b.g = entry["blue"].Vector()[1].Float();
|
b.g = entry["blue"].Vector()[1].Float();
|
||||||
|
@@ -86,10 +86,9 @@ DLL_LINKAGE bool ArtifactUtils::checkSpellbookIsNeeded(const CGHeroInstance * he
|
|||||||
// TODO what'll happen if Titan's thunder is equipped by pickin git up or the start of game?
|
// TODO what'll happen if Titan's thunder is equipped by pickin git up or the start of game?
|
||||||
// Titan's Thunder creates new spellbook on equip
|
// Titan's Thunder creates new spellbook on equip
|
||||||
if(artID == ArtifactID::TITANS_THUNDER && slot == ArtifactPosition::RIGHT_HAND)
|
if(artID == ArtifactID::TITANS_THUNDER && slot == ArtifactPosition::RIGHT_HAND)
|
||||||
{
|
|
||||||
if(heroPtr)
|
|
||||||
{
|
{
|
||||||
if(heroPtr && !heroPtr->hasSpellbook())
|
if(heroPtr && !heroPtr->hasSpellbook())
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user