1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +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:
Ivan Savenko
2013-09-21 18:29:26 +00:00
parent d06b02638b
commit 208df34fc2
25 changed files with 423 additions and 257 deletions

View File

@ -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;