1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
This commit is contained in:
Michał W. Urbańczyk 2011-03-12 22:29:19 +00:00
parent 39120fe4a5
commit a461326380
3 changed files with 7 additions and 8 deletions

View File

@ -970,7 +970,7 @@ std::vector < const CGObjectInstance * > CCallback::getMyObjects() const
std::vector < const CGObjectInstance * > ret;
for (int g=0; g<gs->map->objects.size(); ++g)
{
if (gs->map->objects[g]->tempOwner == LOCPLINT->playerID)
if (gs->map->objects[g] && gs->map->objects[g]->tempOwner == LOCPLINT->playerID)
{
ret.push_back(gs->map->objects[g]);
}

View File

@ -194,16 +194,15 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded /*= fals
{
AdventureMapButton * split = NULL;
{
BLOCK_CAPTURING;
split = new AdventureMapButton(CGI->generaltexth->allTexts[256], CGI->generaltexth->heroscrn[32], boost::bind(&CGarrisonInt::splitClick,garr), pos.x + 539, pos.y + 519, "hsbtns9.def", false, NULL, false); //deleted by garrison destructor
boost::algorithm::replace_first(split->hoverTexts[0],"%s",CGI->generaltexth->allTexts[43]);
}
//delete garr;
OBJ_CONSTRUCTION_CAPTURING_ALL;
if(!garr)
{
garr = new CGarrisonInt(15, 485, 8, Point(), background->bg, Point(15,485), curHero);
{
BLOCK_CAPTURING;
split = new AdventureMapButton(CGI->generaltexth->allTexts[256], CGI->generaltexth->heroscrn[32], boost::bind(&CGarrisonInt::splitClick,garr), pos.x + 539, pos.y + 519, "hsbtns9.def", false, NULL, false); //deleted by garrison destructor
boost::algorithm::replace_first(split->hoverTexts[0],"%s",CGI->generaltexth->allTexts[43]);
}
garr->addSplitBtn(split);
}
if(!artSets.size())

View File

@ -455,7 +455,7 @@ void CGarrisonInt::splitClick()
if(!highlighted)
return;
splitting = !splitting;
show(screen2);
redraw();
}
void CGarrisonInt::splitStacks(int am2)
{