mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	bigfixing & new file: launcher/jsonutils.cpp
- launcher uses json parser from vcmi lib instead of one from Qt #1469 - fixed abilities overrides for some creatures #1476 - fixed hero portraits in seer huts #1402 - ttf fonts will render text in utf-8 mode. Not really useful at this point - new settings entry, available in launcher: encoding. Unused for now.
This commit is contained in:
		| @@ -141,17 +141,29 @@ bool CIdentifierStorage::resolveIdentifier(const ObjectCallback & request) | ||||
| 	auto entries = registeredObjects.equal_range(fullID); | ||||
| 	if (entries.first != entries.second) | ||||
| 	{ | ||||
| 		size_t matchesFound = 0; | ||||
|  | ||||
| 		for (auto it = entries.first; it != entries.second; it++) | ||||
| 		{ | ||||
| 			if (vstd::contains(allowedScopes, it->second.scope)) | ||||
| 			{ | ||||
| 				request.callback(it->second.id); | ||||
| 				return true; | ||||
| 				if (matchesFound == 0) // trigger only once | ||||
| 					request.callback(it->second.id); | ||||
| 				matchesFound++; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if (matchesFound == 1) | ||||
| 			return true; // success, only one matching ID | ||||
|  | ||||
| 		// error found. Try to generate some debug info | ||||
| 		logGlobal->errorStream() << "Unknown identifier " << request.type << "." << request.name << " from mod " << request.localScope; | ||||
| 		if (matchesFound == 0) | ||||
| 			logGlobal->errorStream() << "Unknown identifier!"; | ||||
| 		else | ||||
| 			logGlobal->errorStream() << "Ambiguous identifier request!"; | ||||
|  | ||||
| 		 logGlobal->errorStream() << "Request for " << request.type << "." << request.name << " from mod " << request.localScope; | ||||
|  | ||||
| 		for (auto it = entries.first; it != entries.second; it++) | ||||
| 		{ | ||||
| 			logGlobal->errorStream() << "\tID is available in mod " << it->second.scope; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user