mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
try to plug a few coverity false positives
This commit is contained in:
@ -969,13 +969,13 @@ CCommanderArtPlace::CCommanderArtPlace(Point position, const CGHeroInstance * co
|
|||||||
|
|
||||||
void CCommanderArtPlace::clickLeft(tribool down, bool previousState)
|
void CCommanderArtPlace::clickLeft(tribool down, bool previousState)
|
||||||
{
|
{
|
||||||
if (down && ourArt && text.size())
|
if (ourArt && text.size() && down)
|
||||||
LOCPLINT->showYesNoDialog(CGI->generaltexth->localizedTexts["commanderWindow"]["artifactMessage"].String(), [this] { returnArtToHeroCallback(); }, [] {});
|
LOCPLINT->showYesNoDialog(CGI->generaltexth->localizedTexts["commanderWindow"]["artifactMessage"].String(), [this] { returnArtToHeroCallback(); }, [] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCommanderArtPlace::clickRight(tribool down, bool previousState)
|
void CCommanderArtPlace::clickRight(tribool down, bool previousState)
|
||||||
{
|
{
|
||||||
if (down && ourArt && text.size())
|
if (ourArt && text.size() && down)
|
||||||
CArtPlace::clickRight(down, previousState);
|
CArtPlace::clickRight(down, previousState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ void CHeroGSlot::clickLeft(tribool down, bool previousState)
|
|||||||
|
|
||||||
void CHeroGSlot::clickRight(tribool down, bool previousState)
|
void CHeroGSlot::clickRight(tribool down, bool previousState)
|
||||||
{
|
{
|
||||||
if(down && hero)
|
if(hero && down)
|
||||||
{
|
{
|
||||||
GH.pushInt(new CInfoBoxPopup(Point(pos.x + 175, pos.y + 100), hero));
|
GH.pushInt(new CInfoBoxPopup(Point(pos.x + 175, pos.y + 100), hero));
|
||||||
}
|
}
|
||||||
@ -1157,7 +1157,7 @@ void CTownInfo::hover(bool on)
|
|||||||
|
|
||||||
void CTownInfo::clickRight(tribool down, bool previousState)
|
void CTownInfo::clickRight(tribool down, bool previousState)
|
||||||
{
|
{
|
||||||
if(down && building)
|
if(building && down)
|
||||||
CRClickPopup::createAndPush(CInfoWindow::genText(building->Name(), building->Description()),
|
CRClickPopup::createAndPush(CInfoWindow::genText(building->Name(), building->Description()),
|
||||||
new CComponent(CComponent::building, building->town->faction->index, building->bid));
|
new CComponent(CComponent::building, building->town->faction->index, building->bid));
|
||||||
|
|
||||||
@ -1664,9 +1664,6 @@ void CFortScreen::RecruitArea::clickRight(tribool down, bool previousState)
|
|||||||
clickLeft(down, false); //r-click does same as l-click - opens recr. window
|
clickLeft(down, false); //r-click does same as l-click - opens recr. window
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner,std::string imagem) :CWindowObject(BORDERED,imagem)
|
CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner,std::string imagem) :CWindowObject(BORDERED,imagem)
|
||||||
{
|
{
|
||||||
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
||||||
|
@ -529,7 +529,7 @@ CSpellWindow::SpellArea::~SpellArea()
|
|||||||
|
|
||||||
void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
|
void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
|
||||||
{
|
{
|
||||||
if(!down && mySpell)
|
if(mySpell && !down)
|
||||||
{
|
{
|
||||||
int spellCost = owner->myInt->cb->getSpellCost(mySpell, owner->myHero);
|
int spellCost = owner->myInt->cb->getSpellCost(mySpell, owner->myHero);
|
||||||
if(spellCost > owner->myHero->mana) //insufficient mana
|
if(spellCost > owner->myHero->mana) //insufficient mana
|
||||||
@ -752,7 +752,7 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
|
|||||||
|
|
||||||
void CSpellWindow::SpellArea::clickRight(tribool down, bool previousState)
|
void CSpellWindow::SpellArea::clickRight(tribool down, bool previousState)
|
||||||
{
|
{
|
||||||
if(down && mySpell)
|
if(mySpell && down)
|
||||||
{
|
{
|
||||||
std::string dmgInfo;
|
std::string dmgInfo;
|
||||||
int causedDmg = owner->myInt->cb->estimateSpellDamage(mySpell, owner->myHero);
|
int causedDmg = owner->myInt->cb->estimateSpellDamage(mySpell, owner->myHero);
|
||||||
|
Reference in New Issue
Block a user