mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
* fixed crashbug in herolist
This commit is contained in:
parent
16a1861fc4
commit
42c6428a19
@ -261,8 +261,11 @@ void CHeroList::mouseMoved (SDL_MouseMotionEvent & sEvent)
|
|||||||
hx-=pos.x;
|
hx-=pos.x;
|
||||||
hy-=pos.y; hy-=arrup->ourImages[0].bitmap->h;
|
hy-=pos.y; hy-=arrup->ourImages[0].bitmap->h;
|
||||||
float ny = (float)hy/(float)32;
|
float ny = (float)hy/(float)32;
|
||||||
if (ny>5 || ny<0)
|
if ((ny>5 || ny<0) || (from+ny>=items.size()))
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->statusbar.clear();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
std::vector<std::string> temp;
|
std::vector<std::string> temp;
|
||||||
temp+=(items[from+ny]->name),(items[from+ny]->type->heroClass->name);
|
temp+=(items[from+ny]->name),(items[from+ny]->type->heroClass->name);
|
||||||
LOCPLINT->adventureInt->statusbar.print( processStr(CGI->generaltexth->allTexts[15],temp) );
|
LOCPLINT->adventureInt->statusbar.print( processStr(CGI->generaltexth->allTexts[15],temp) );
|
||||||
|
Loading…
Reference in New Issue
Block a user