mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
try to plug a few coverity false positives
This commit is contained in:
parent
60b1a9ac52
commit
312793efd9
@ -969,13 +969,13 @@ CCommanderArtPlace::CCommanderArtPlace(Point position, const CGHeroInstance * co
|
||||
|
||||
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(); }, [] {});
|
||||
}
|
||||
|
||||
void CCommanderArtPlace::clickRight(tribool down, bool previousState)
|
||||
{
|
||||
if (down && ourArt && text.size())
|
||||
if (ourArt && text.size() && down)
|
||||
CArtPlace::clickRight(down, previousState);
|
||||
}
|
||||
|
||||
|
@ -398,7 +398,7 @@ void CHeroGSlot::clickLeft(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));
|
||||
}
|
||||
@ -1157,7 +1157,7 @@ void CTownInfo::hover(bool on)
|
||||
|
||||
void CTownInfo::clickRight(tribool down, bool previousState)
|
||||
{
|
||||
if(down && building)
|
||||
if(building && down)
|
||||
CRClickPopup::createAndPush(CInfoWindow::genText(building->Name(), building->Description()),
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner,std::string imagem) :CWindowObject(BORDERED,imagem)
|
||||
{
|
||||
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
||||
|
@ -529,7 +529,7 @@ CSpellWindow::SpellArea::~SpellArea()
|
||||
|
||||
void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
|
||||
{
|
||||
if(!down && mySpell)
|
||||
if(mySpell && !down)
|
||||
{
|
||||
int spellCost = owner->myInt->cb->getSpellCost(mySpell, owner->myHero);
|
||||
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)
|
||||
{
|
||||
if(down && mySpell)
|
||||
if(mySpell && down)
|
||||
{
|
||||
std::string dmgInfo;
|
||||
int causedDmg = owner->myInt->cb->estimateSpellDamage(mySpell, owner->myHero);
|
||||
|
Loading…
Reference in New Issue
Block a user