diff --git a/CAdvmapInterface.cpp b/CAdvmapInterface.cpp index 1c1c204eb..601916831 100644 --- a/CAdvmapInterface.cpp +++ b/CAdvmapInterface.cpp @@ -477,30 +477,20 @@ void CTerrainRect::clickLeft(tribool down) } //still here? we need to move hero if we clicked end of already selected path or calculate a new path otherwise - if (currentPath) + if (currentPath && currentPath->endPos() == mp)//we'll be moving { - if (currentPath->endPos() == mp) //we'll be moving - { - LOCPLINT->pim->unlock(); - LOCPLINT->moveHero(currentHero,*currentPath); - LOCPLINT->pim->lock(); - } - else //remove an old path - { - delete currentPath; - currentPath=NULL; - LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.getPosOfHero(LOCPLINT->adventureInt->selection)].second = NULL; - } + LOCPLINT->pim->unlock(); + LOCPLINT->moveHero(currentHero,*currentPath); + LOCPLINT->pim->lock(); } else //remove old path and find a new one { int3 bufpos = currentHero->getPosition(false); - CPath *& pathForCurhero = LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].second; if(pathForCurhero) delete pathForCurhero; - currentPath = pathForCurhero = LOCPLINT->cb->getPath(bufpos, mp, currentHero);; + currentPath = pathForCurhero = LOCPLINT->cb->getPath(bufpos, mp, currentHero); } } //end of hero is selected "case" } @@ -605,7 +595,11 @@ void CTerrainRect::mouseMoved (const SDL_MouseMotionEvent & sEvent) void CTerrainRect::hover(bool on) { if (!on) + { LOCPLINT->adventureInt->statusbar.clear(); + CGI->curh->changeGraphic(0,0); + } + Hoverable::hover(on); } void CTerrainRect::showPath(const SDL_Rect * extRect) { @@ -1357,11 +1351,6 @@ void CAdvMapInt::fendTurn() void CAdvMapInt::activate() { - if(subInt == heroWindow) - { - heroWindow->activate(); - return; - } if(active++) { tlog1 << "Error: advmapint already active...\n"; @@ -1390,11 +1379,6 @@ void CAdvMapInt::activate() } void CAdvMapInt::deactivate() { - if(subInt == heroWindow) - { - heroWindow->deactivate(); - return; - } KeyInterested::deactivate(); hide(); diff --git a/CMessage.cpp b/CMessage.cpp index 4fa26122c..ba48c27e5 100644 --- a/CMessage.cpp +++ b/CMessage.cpp @@ -557,6 +557,7 @@ ComponentsToBlit::ComponentsToBlit(std::vector & SComps, int maxw, else { curw += toadd; + amax(w,curw); } comps[curr].push_back(cur); diff --git a/CPlayerInterface.cpp b/CPlayerInterface.cpp index 54d5cbc53..333ed4a76 100644 --- a/CPlayerInterface.cpp +++ b/CPlayerInterface.cpp @@ -2925,7 +2925,7 @@ void CHeroList::clickLeft(tribool down) from--; if (from<0) from=0; - draw(screen2); + draw(screen); } } else if (!pressed) //down @@ -2938,7 +2938,7 @@ void CHeroList::clickLeft(tribool down) //if (fromadventureInt->handleRightClick(CGI->generaltexth->zelp[304].second,down,this); } - //if not buttons then heroes - int hx = LOCPLINT->current->motion.x, hy = LOCPLINT->current->motion.y; - hx-=pos.x; - hy-=pos.y; hy-=arrup->ourImages[0].bitmap->h; - int ny = hy/32; - if ((ny>SIZE || ny<0) || (from+ny>=items.size())) + else { - return; - } + //if not buttons then heroes + int hx = LOCPLINT->current->motion.x, hy = LOCPLINT->current->motion.y; + hx-=pos.x; + hy-=pos.y; hy-=arrup->ourImages[0].bitmap->h; + int ny = hy/32; + if ((ny>SIZE || ny<0) || (from+ny>=items.size())) + { + return; + } - //show popup - CInfoPopup * ip = new CInfoPopup(graphics->heroWins[items[from+ny].first->subID], - LOCPLINT->current->motion.x-graphics->heroWins[items[from+ny].first->subID]->w, - LOCPLINT->current->motion.y-graphics->heroWins[items[from+ny].first->subID]->h, - false); - LOCPLINT->pushInt(ip); + //show popup + CInfoPopup * ip = new CInfoPopup(graphics->heroWins[items[from+ny].first->subID], + LOCPLINT->current->motion.x-graphics->heroWins[items[from+ny].first->subID]->w, + LOCPLINT->current->motion.y-graphics->heroWins[items[from+ny].first->subID]->h, + false); + LOCPLINT->pushInt(ip); + } } else { diff --git a/hch/CObjectHandler.cpp b/hch/CObjectHandler.cpp index 0b3c36584..082925525 100644 --- a/hch/CObjectHandler.cpp +++ b/hch/CObjectHandler.cpp @@ -1658,7 +1658,7 @@ void CGResource::onHeroVisit( const CGHeroInstance * h ) const } else { - fightForRes(0,h); + fightForRes(1,h); } } else