1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Fixed moving creatures in garison in heroWindow

This commit is contained in:
Michał W. Urbańczyk 2008-04-19 19:29:00 +00:00
parent 8fca3147b3
commit d7b5099b6f
2 changed files with 10 additions and 1 deletions

View File

@ -134,4 +134,5 @@ public:
//friends
friend void CArtPlace::clickLeft(tribool down);
friend CPlayerInterface;
};

View File

@ -345,6 +345,7 @@ void CGarrisonInt::deleteSlots()
void CGarrisonInt::recreateSlots()
{
splitting = false;
highlighted = NULL;
deactiveteSlots();
deleteSlots();
createSlots();
@ -1913,11 +1914,18 @@ void CPlayerInterface::garrisonChanged(const CGObjectInstance * obj)
SDL_FreeSurface(heroWins[hh->subID]);
heroWins[hh->subID] = infoWin(hh);
}
if(castleInt == curint) //opened town window - redraw town garrsion slots (change is within hero garr)
CHeroWindow * hw = dynamic_cast<CHeroWindow *>(curint);
if(hw)
{
hw->garInt->recreateSlots();
hw->garInt->show();
}
else if(castleInt == curint) //opened town window - redraw town garrsion slots (change is within hero garr)
{
castleInt->garr->highlighted = NULL;
castleInt->garr->recreateSlots();
}
}
else if (obj->ID == 98) //town
{