diff --git a/CHeroWindow.h b/CHeroWindow.h index 18397b27f..6727b5d06 100644 --- a/CHeroWindow.h +++ b/CHeroWindow.h @@ -134,4 +134,5 @@ public: //friends friend void CArtPlace::clickLeft(tribool down); + friend CPlayerInterface; }; diff --git a/CPlayerInterface.cpp b/CPlayerInterface.cpp index 3d833981e..d6978c450 100644 --- a/CPlayerInterface.cpp +++ b/CPlayerInterface.cpp @@ -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(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 {