mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	crash fix: dismiss hero when pick artifact
This commit is contained in:
		| @@ -140,6 +140,8 @@ void CArtifactsOfHeroBase::gestureArtPlace(CComponentHolder & artPlace, const Po | ||||
| void CArtifactsOfHeroBase::setHero(const CGHeroInstance * hero) | ||||
| { | ||||
| 	curHero = hero; | ||||
| 	if (!hero) | ||||
| 		return; | ||||
|  | ||||
| 	for(auto slot : artWorn) | ||||
| 	{ | ||||
|   | ||||
| @@ -28,7 +28,8 @@ CArtifactsOfHeroMain::CArtifactsOfHeroMain(const Point & position) | ||||
|  | ||||
| CArtifactsOfHeroMain::~CArtifactsOfHeroMain() | ||||
| { | ||||
| 	CArtifactsOfHeroBase::putBackPickedArtifact(); | ||||
| 	if(curHero) | ||||
| 		CArtifactsOfHeroBase::putBackPickedArtifact(); | ||||
| } | ||||
|  | ||||
| void CArtifactsOfHeroMain::keyPressed(EShortcut key) | ||||
|   | ||||
| @@ -312,6 +312,7 @@ void CHeroWindow::dismissCurrent() | ||||
| 			arts->putBackPickedArtifact(); | ||||
| 			close(); | ||||
| 			LOCPLINT->cb->dismissHero(curHero); | ||||
| 			arts->setHero(nullptr); | ||||
| 		}, nullptr); | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user