diff options
Diffstat (limited to 'src/Root.cpp')
-rw-r--r-- | src/Root.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Root.cpp b/src/Root.cpp index 8ccf55d47..0cece9e6d 100644 --- a/src/Root.cpp +++ b/src/Root.cpp @@ -473,7 +473,7 @@ void cRoot::LoadWorlds(cDeadlockDetect & a_dd, cSettingsRepositoryInterface & a_ // Get the default world AString DefaultWorldName = a_Settings.GetValueSet("Worlds", "DefaultWorld", "world"); AString DefaultWorldPath = a_Settings.GetValueSet("WorldPaths", DefaultWorldName, DefaultWorldName); - m_pDefaultWorld = new cWorld(DefaultWorldName.c_str(), DefaultWorldPath.c_str(), a_dd, WorldNames); + m_pDefaultWorld = new cWorld(DefaultWorldName, DefaultWorldPath, a_dd, WorldNames); m_WorldsByName[ DefaultWorldName ] = m_pDefaultWorld; // Then load the other worlds @@ -505,7 +505,7 @@ void cRoot::LoadWorlds(cDeadlockDetect & a_dd, cSettingsRepositoryInterface & a_ */ bool FoundAdditionalWorlds = false; - for (auto WorldNameValue : Worlds) + for (const auto & WorldNameValue : Worlds) { AString ValueName = WorldNameValue.first; if (ValueName.compare("World") != 0) @@ -527,7 +527,7 @@ void cRoot::LoadWorlds(cDeadlockDetect & a_dd, cSettingsRepositoryInterface & a_ // The default world is an overworld with no links eDimension Dimension = dimOverworld; - AString LinkTo = ""; + AString LinkTo; // if the world is called x_nether if ((LowercaseName.size() > NetherAppend.size()) && (LowercaseName.substr(LowercaseName.size() - NetherAppend.size()) == NetherAppend)) @@ -571,7 +571,7 @@ void cRoot::LoadWorlds(cDeadlockDetect & a_dd, cSettingsRepositoryInterface & a_ } Dimension = dimEnd; } - NewWorld = new cWorld(WorldName.c_str(), WorldPath.c_str(), a_dd, WorldNames, Dimension, LinkTo); + NewWorld = new cWorld(WorldName, WorldPath, a_dd, WorldNames, Dimension, LinkTo); m_WorldsByName[WorldName] = NewWorld; } // for i - Worlds @@ -891,11 +891,7 @@ bool cRoot::FindAndDoWithPlayer(const AString & a_PlayerName, cPlayerListCallbac m_BestRating = Rating; ++m_NumMatches; } - if (Rating == m_NameLength) // Perfect match - { - return true; - } - return false; + return (Rating == m_NameLength); // Perfect match } cCallback (const AString & a_CBPlayerName) : |