mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	* slider position updated after sorting in pregame
* proper initialization of portrait in CGHeroInstance
This commit is contained in:
		| @@ -25,6 +25,7 @@ using namespace CSDL_Ext; | ||||
|  | ||||
| CGlobalAI * CAIHandler::getNewAI(CCallback * cb, std::string dllname) | ||||
| { | ||||
| 	std::cout << "Opening "<<dllname/*<<" for player "<< cb->player*/<<std::endl; | ||||
| 	dllname = "AI/"+dllname; | ||||
| 	CGlobalAI * ret=NULL; | ||||
| 	CGlobalAI*(*getAI)(); | ||||
|   | ||||
| @@ -1782,6 +1782,7 @@ void CPreGame::scenHandleEv(SDL_Event& sEvent) | ||||
| 					ourScenSel->mapsel.slid->updateSlid(); | ||||
| 					ourScenSel->mapsel.slid->positionsAmnt=ourScenSel->mapsel.countWL(); | ||||
| 					ourScenSel->mapsel.select(ourScenSel->mapsel.whichWL(0)); | ||||
| 					 | ||||
| 					ourScenSel->mapsel.printMaps(0); | ||||
| 				} | ||||
| 			} | ||||
| @@ -2127,6 +2128,8 @@ void CPreGame::sortMaps() | ||||
| 	if(ourScenSel->mapsel.sortBy != _name) | ||||
| 		std::stable_sort(ourScenSel->mapsel.ourMaps.begin(),ourScenSel->mapsel.ourMaps.end(),mapSorter(ourScenSel->mapsel.sortBy)); | ||||
| 	ourScenSel->mapsel.select(ourScenSel->mapsel.whichWL(0),false,true); | ||||
| 	ourScenSel->mapsel.slid->whereAreWe=0; | ||||
| 	ourScenSel->mapsel.slid->updateSlid(); | ||||
| 	printMapsFrom(0); | ||||
| } | ||||
| void CPreGame::setTurnLength(int on) | ||||
|   | ||||
| @@ -1270,7 +1270,7 @@ void CAmbarCendamo::deh3m() | ||||
| 				nhi->pos = nobj->pos; | ||||
| 				nhi->type = spec->type; | ||||
| 				nhi->army = spec->garrison; | ||||
| 				nhi->portrait = -1; // TODO: przypisywac portret | ||||
| 				nhi->portrait = nobj->subID; // TODO: przypisywac portret | ||||
| 				nhi->artifWorn[8] = spec->artifWorn[8]; | ||||
| 				nhi->artifWorn[0] = spec->artifWorn[0]; | ||||
| 				nhi->artifacts = spec->artifacts; | ||||
|   | ||||
| @@ -232,7 +232,7 @@ void CMapHandler::randomizeObject(CGObjectInstance *cur) | ||||
| 		CGHeroInstance *h = dynamic_cast<CGHeroInstance *>(cur); | ||||
| 		if(!h) {std::cout<<"Wrong random hero at "<<cur->pos<<std::endl; return;} | ||||
| 		cur->ID = ran.first; | ||||
| 		cur->subID = ran.second; | ||||
| 		h->portrait = cur->subID = ran.second; | ||||
| 		h->type = CGI->heroh->heroes[ran.second]; | ||||
| 		CGI->heroh->heroInstances.push_back(h); | ||||
| 		CGI->objh->objInstances.erase(std::find(CGI->objh->objInstances.begin(),CGI->objh->objInstances.end(),h)); | ||||
| @@ -1432,6 +1432,7 @@ CGObjectInstance * CMapHandler::createObject(int id, int subid, int3 pos, int ow | ||||
| 			nobj->artifWorn.resize(20); | ||||
| 			nobj->artifacts.resize(20); | ||||
| 			nobj->artifWorn[16] = &CGI->arth->artifacts[3]; | ||||
| 			nobj->portrait = subid; | ||||
| 			nobj->primSkills.resize(4); | ||||
| 			nobj->primSkills[0] = nobj->type->heroClass->initialAttack; | ||||
| 			nobj->primSkills[1] = nobj->type->heroClass->initialDefence; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user