1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00
This commit is contained in:
AlexVinS
2016-10-01 18:18:46 +03:00
parent 799b8519e0
commit 52ae5b4a86
2 changed files with 13 additions and 5 deletions

View File

@@ -618,9 +618,7 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
int spellCost = owner->myInt->cb->getSpellCost(sp, owner->myHero);
if(spellCost > owner->myHero->mana) //insufficient mana
{
char msgBuf[500];
sprintf(msgBuf, CGI->generaltexth->allTexts[206].c_str(), spellCost, owner->myHero->mana);
owner->myInt->showInfoDialog(std::string(msgBuf));
owner->myInt->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[206]) % spellCost % owner->myHero->mana));
return;
}
//battle spell on adv map or adventure map spell during combat => display infowindow, not cast
@@ -702,6 +700,13 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
owner->myInt->showInfoDialog(CGI->generaltexth->allTexts[185]);
}
break;
default:
{
// General message:
std::string text = CGI->generaltexth->allTexts[541], caster = owner->myHero->name;
text = boost::str(boost::format(text) % caster);
owner->myInt->showInfoDialog(text);
}
}
}
else if(sp->isAdventureSpell() && !owner->myInt->battleInt) //adventure spell and not in battle