mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Add commander resurrection info window upon entering town
This commit is contained in:
		| @@ -562,15 +562,25 @@ void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const | ||||
| 	} | ||||
| 	else if(h->visitablePos() == visitablePos()) | ||||
| 	{ | ||||
| 		if (h->commander && !h->commander->alive) //rise commander. TODO: interactive script | ||||
| 		bool commander_recover = h->commander && !h->commander->alive; | ||||
| 		if (commander_recover) // rise commander from dead | ||||
| 		{ | ||||
| 			SetCommanderProperty scp; | ||||
| 			scp.heroid = h->id; | ||||
| 			scp.which = SetCommanderProperty::ALIVE; | ||||
| 			scp.amount = 1; | ||||
| 			cb->sendAndApply (&scp); | ||||
| 			cb->sendAndApply(&scp); | ||||
| 		} | ||||
| 		cb->heroVisitCastle(this, h); | ||||
| 		// TODO(vmarkovtsev): implement payment for rising the commander | ||||
| 		if (commander_recover) // info window about commander | ||||
| 		{ | ||||
| 			InfoWindow iw; | ||||
| 			iw.player = h->tempOwner; | ||||
| 			iw.text << h->commander->getName(); | ||||
| 			iw.components.push_back(Component(*h->commander)); | ||||
| 			cb->showInfoDialog(&iw); | ||||
| 		} | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user