diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index cd45ddcf5..9be1e8a7f 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -145,7 +145,7 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat "\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n" "\n\twin1252 - Western European (Latin) alphabet, used by default") - ("fallback", bpo::value()->default_value(FallbackMap(), "") + ("fallback", bpo::value()->default_value(EscapeFallbackMap(), "") ->multitoken()->composing(), "fallback values") ("no-grab", "Don't grab mouse cursor") @@ -248,7 +248,7 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat // other settings engine.setSoundUsage(!variables["no-sound"].as()); - engine.setFallbackValues(variables["fallback"].as().mMap); + engine.setFallbackValues(variables["fallback"].as().toFallbackMap().mMap); engine.setActivationDistanceOverride (variables["activate-dist"].as()); engine.enableFontExport(variables["export-fonts"].as()); diff --git a/components/fallback/validate.hpp b/components/fallback/validate.hpp index 531711544..c41ff6b96 100644 --- a/components/fallback/validate.hpp +++ b/components/fallback/validate.hpp @@ -13,9 +13,22 @@ namespace Fallback { struct FallbackMap { - std::map mMap; + std::map mMap; }; + struct EscapeFallbackMap : FallbackMap + { + std::map mMap; + + FallbackMap toFallbackMap() const + { + FallbackMap temp = FallbackMap(); + for (std::map::const_iterator it = mMap.begin(); it != mMap.end(); ++it) + temp.mMap[it->first.toStdString()] = it->second.toStdString(); + return temp; + } + }; + void validate(boost::any &v, std::vector const &tokens, FallbackMap*, int) { if(v.empty())