mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fixed crash when r-clicking spell.
This commit is contained in:
		| @@ -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); | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -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() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user