mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Version set to 0.8. (not release yet, waiting for a few more fixes)
* fixed possible crash on visiting Obelisk * fixed #394, #391, #395, #373
This commit is contained in:
		| @@ -418,7 +418,8 @@ void CPlayerInterface::heroManaPointsChanged(const CGHeroInstance * hero) | ||||
| void CPlayerInterface::heroMovePointsChanged(const CGHeroInstance * hero) | ||||
| { | ||||
| 	boost::unique_lock<boost::recursive_mutex> un(*pim); | ||||
| 	//adventureInt->heroList.draw(); | ||||
| 	if(makingTurn && hero->tempOwner == playerID) | ||||
| 		adventureInt->heroList.redraw(); | ||||
| } | ||||
| void CPlayerInterface::receivedResource(int type, int val) | ||||
| { | ||||
| @@ -1797,6 +1798,7 @@ void CPlayerInterface::playerBonusChanged( const HeroBonus &bonus, bool gain ) | ||||
| void CPlayerInterface::showPuzzleMap() | ||||
| { | ||||
| 	waitWhileDialog(); | ||||
| 	boost::unique_lock<boost::recursive_mutex> un(*pim); | ||||
|  | ||||
| 	//TODO: interface should not know the real position of Grail... | ||||
| 	float ratio = 0; | ||||
|   | ||||
| @@ -109,8 +109,17 @@ void CMapInfo::mapInit(const std::string &fname, const unsigned char *map ) | ||||
| 	mapHeader = new CMapHeader(); | ||||
| 	mapHeader->version = CMapHeader::invalid; | ||||
|  | ||||
| 	mapHeader->initFromMemory(map, i); | ||||
| 	countPlayers(); | ||||
| 	try | ||||
| 	{ | ||||
| 		mapHeader->initFromMemory(map, i); | ||||
| 		countPlayers(); | ||||
| 	} | ||||
| 	catch (const std::string &e) | ||||
| 	{ | ||||
| 		tlog1 << "\t\tWarning: evil map file: " << fname << ": " << e << std::endl;  | ||||
| 		delete mapHeader; | ||||
| 		mapHeader = NULL; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| CMapInfo::~CMapInfo() | ||||
| @@ -567,9 +576,20 @@ void SelectionTab::getFiles(std::vector<FileInfo> &out, const std::string &dirna | ||||
| 		if(fs::is_regular_file(file->status()) | ||||
| 			&& boost::ends_with(file->path().filename(), ext)) | ||||
| 		{ | ||||
| 			out.resize(out.size()+1); | ||||
| 			out.back().date = fs::last_write_time(file->path()); | ||||
| 			out.back().name = file->path().string(); | ||||
| 			std::time_t date = 0; | ||||
| 			try | ||||
| 			{ | ||||
| 				date = fs::last_write_time(file->path()); | ||||
|  | ||||
| 				out.resize(out.size()+1); | ||||
| 				out.back().date = date; | ||||
| 				out.back().name = file->path().string(); | ||||
| 			} | ||||
| 			catch(...) | ||||
| 			{ | ||||
| 				tlog2 << "\t\tWarning: very corrupted map file: " << file->path().string() << std::endl;  | ||||
| 			} | ||||
|  | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -87,6 +87,12 @@ void SetMana::applyCl( CClient *cl ) | ||||
| void SetMovePoints::applyCl( CClient *cl ) | ||||
| { | ||||
| 	CGHeroInstance *h = GS(cl)->getHero(hid); | ||||
|  | ||||
| 	if (cl->IGameCallback::getSelectedHero(LOCPLINT->playerID) == h)//if we have selected that hero | ||||
| 	{ | ||||
| 		GS(cl)->calculatePaths(h, *cl->pathInfo); | ||||
| 	} | ||||
|  | ||||
| 	if(vstd::contains(cl->playerint,h->tempOwner)) | ||||
| 		cl->playerint[h->tempOwner]->heroMovePointsChanged(h); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user