1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Fixed 563 & 701.

It's not nice to write same piece of code twice.
This commit is contained in:
DjWarmonger
2011-03-08 13:27:32 +00:00
parent 2fc2fa539d
commit f7bd5e75cb
4 changed files with 38 additions and 19 deletions

View File

@ -4873,6 +4873,7 @@ void CGPandoraBox::giveContents( const CGHeroInstance *h, bool afterBattle ) con
{
InfoWindow iw;
iw.player = h->getOwner();
std::string msg = message; //in case box is removed in the meantime
bool changesPrimSkill = false;
for (int i = 0; i < primskills.size(); i++)
@ -5044,11 +5045,10 @@ void CGPandoraBox::giveContents( const CGHeroInstance *h, bool afterBattle ) con
cb->showInfoDialog(&iw);
cb->giveCreatures(this, h, creatures, true);
//boost::bind(&CGPandoraBox::endBattle, this, h, _1)
}
if(!afterBattle && message.size())
if(!afterBattle && msg.size())
{
iw.text << message;
iw.text << msg;
cb->showInfoDialog(&iw);
}
if (!creatures.Slots().size())