mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixed crash on closing creature info window when upgrade was possible ( http://forum.vcmi.eu/viewtopic.php?p=4669#4669 ).
This commit is contained in:
parent
585bc8ae6b
commit
abf54deaa3
@ -1268,6 +1268,10 @@ void CPlayerInterface::update()
|
||||
if(terminate_cond.get())
|
||||
return;
|
||||
|
||||
//in some conditions we may receive calls before selection is initialized - we must ignore them
|
||||
if(!adventureInt->selection)
|
||||
return;
|
||||
|
||||
//if there are any waiting dialogs, show them
|
||||
if(dialogs.size() && !showingDialog->get())
|
||||
{
|
||||
|
@ -2243,11 +2243,11 @@ CCreInfoWindow::CCreInfoWindow(const CStackInstance &st, int Type, boost::functi
|
||||
|
||||
if(enough)
|
||||
{
|
||||
CFunctionList<void()> fs[2];
|
||||
fs[0] += Upg;
|
||||
fs[0] += boost::bind(&CCreInfoWindow::close,this);
|
||||
CFunctionList<void()> fs;
|
||||
fs += Upg;
|
||||
fs += boost::bind(&CCreInfoWindow::close,this);
|
||||
CFunctionList<void()> cfl;
|
||||
cfl = boost::bind(&CPlayerInterface::showYesNoDialog,LOCPLINT,CGI->generaltexth->allTexts[207],boost::ref(upgResCost),fs[0],fs[1],false);
|
||||
cfl = boost::bind(&CPlayerInterface::showYesNoDialog, LOCPLINT, CGI->generaltexth->allTexts[207], boost::ref(upgResCost), fs, 0, false);
|
||||
upgrade = new AdventureMapButton("",CGI->generaltexth->zelp[446].second,cfl,76,237,"IVIEWCR.DEF",SDLK_u);
|
||||
}
|
||||
else
|
||||
@ -2374,8 +2374,8 @@ CCreInfoWindow::CCreInfoWindow(int Cid, int Type, int creatureCount)
|
||||
CCreInfoWindow::~CCreInfoWindow()
|
||||
{
|
||||
delete anim;
|
||||
for(int i=0; i<upgResCost.size();i++)
|
||||
delete upgResCost[i];
|
||||
// for(int i=0; i<upgResCost.size();i++)
|
||||
// delete upgResCost[i];
|
||||
}
|
||||
|
||||
void CCreInfoWindow::activate()
|
||||
|
@ -310,8 +310,7 @@ public:
|
||||
{
|
||||
h & static_cast<CArmedInstance&>(*this);
|
||||
h & exp & level & name & biography & portrait & mana & secSkills & movement
|
||||
& sex & inTownGarrison & artifacts & artifWorn & spells & patrol & bonuses
|
||||
& moveDir;
|
||||
& sex & inTownGarrison & artifacts & artifWorn & spells & patrol & moveDir;
|
||||
|
||||
h & type;
|
||||
//visitied town pointer will be restored by map serialization method
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
const ui32 version = 721;
|
||||
const ui32 version = 722;
|
||||
class CConnection;
|
||||
class CGObjectInstance;
|
||||
class CGameState;
|
||||
|
Loading…
Reference in New Issue
Block a user