1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Fixed crash when r-clicking spell.

This commit is contained in:
Michał W. Urbańczyk
2009-08-23 18:23:21 +00:00
parent 1f79af440f
commit 579b7236b7
2 changed files with 9 additions and 9 deletions

View File

@@ -666,14 +666,11 @@ void CSpellWindow::SpellArea::clickRight(tribool down, bool previousState)
{
if(down && mySpell != -1)
{
CInfoPopup *vinya = new CInfoPopup();
vinya->free = true;
vinya->bitmap = CMessage::drawBoxTextBitmapSub(
SDL_Surface *spellBox = CMessage::drawBoxTextBitmapSub(
LOCPLINT->playerID,
CGI->spellh->spells[mySpell].descriptions[0], this->owner->spells->ourImages[mySpell].bitmap,
CGI->spellh->spells[mySpell].name,30,30);
vinya->pos.x = screen->w/2 - vinya->bitmap->w/2;
vinya->pos.y = screen->h/2 - vinya->bitmap->h/2;
CInfoPopup *vinya = new CInfoPopup(spellBox, true);
GH.pushInt(vinya);
}
}

View File

@@ -684,10 +684,13 @@ CInfoPopup::CInfoPopup(SDL_Surface *Bitmap, bool Free)
free=Free;
bitmap=Bitmap;
pos.x = screen->w/2 - bitmap->w/2;
pos.y = screen->h/2 - bitmap->h/2;
pos.h = bitmap->h;
pos.w = bitmap->w;
if(bitmap)
{
pos.x = screen->w/2 - bitmap->w/2;
pos.y = screen->h/2 - bitmap->h/2;
pos.h = bitmap->h;
pos.w = bitmap->w;
}
}
void CInfoPopup::close()