forked from mirror/openmw-tes3mp
typo; World::getFallback(std::string key, std::string def)
This commit is contained in:
parent
16e7bf353a
commit
48b7b03453
3 changed files with 9 additions and 2 deletions
|
@ -71,7 +71,7 @@ void validate(boost::any &v, std::vector<std::string> const &tokens, FallbackMap
|
|||
for(std::vector<std::string>::const_iterator it=tokens.begin(); it != tokens.end(); it++)
|
||||
{
|
||||
int sep = it->find(",");
|
||||
if(sep < 1 || sep = it->length()-1)
|
||||
if(sep < 1 || sep == (it->length()-1))
|
||||
throw boost::program_options::validation_error(boost::program_options::validation_error::invalid_option_value);
|
||||
|
||||
std::string key(it->substr(0,sep));
|
||||
|
|
|
@ -158,11 +158,16 @@ namespace MWWorld
|
|||
}
|
||||
|
||||
std::string World::getFallback(std::string key)
|
||||
{
|
||||
return getFallback(key, "");
|
||||
}
|
||||
|
||||
std::string World::getFallback(std::string key, std::string def)
|
||||
{
|
||||
std::map<std::string,std::string>::iterator it;
|
||||
if((it = mFallback.find(key)) == mFallback.end())
|
||||
{
|
||||
return std::string("");
|
||||
return def;
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
|
|
@ -130,6 +130,8 @@ namespace MWWorld
|
|||
|
||||
std::string getFallback(std::string key);
|
||||
|
||||
std::string getFallback(std::string key, std::string def);
|
||||
|
||||
MWWorld::Player& getPlayer();
|
||||
|
||||
const ESMS::ESMStore& getStore() const;
|
||||
|
|
Loading…
Reference in a new issue