1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

primary skill identifiers for bonuses

This commit is contained in:
mateuszb
2013-02-25 09:48:26 +00:00
parent e8c35bdb24
commit 10fbe7b11e
4 changed files with 100 additions and 92 deletions

View File

@ -51,7 +51,12 @@ void CIdentifierStorage::requestIdentifier(std::string name, const boost::functi
if (iter != registeredObjects.end())
callback(iter->second); //already registered - trigger callback immediately
else
{
if(boost::algorithm::starts_with(name, "primSkill."))
tlog2 << "incorrect primSkill name requested\n";
missingObjects[name].push_back(callback); // queue callback
}
}
void CIdentifierStorage::registerObject(std::string name, si32 identifier)
@ -93,6 +98,9 @@ CModHandler::CModHandler()
identifiers.registerObject("resource." + GameConstants::RESOURCE_NAMES[i], i);
}
for(int i=0; i<GameConstants::PRIMARY_SKILLS; ++i)
identifiers.registerObject("primSkill." + PrimarySkill::names[i], i);
loadConfigFromFile ("defaultMods");
}