diff options
author | peterbell10 <peterbell10@live.co.uk> | 2020-05-15 00:15:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 00:15:35 +0200 |
commit | 13144a08e496b89b34093ffd3d810d3442df3c44 (patch) | |
tree | 406d79e17b69560564fdb0972a3c50542a3a96c6 /src/Root.cpp | |
parent | Generate "LuaState_Typedefs.inc" before running clang-tidy (diff) | |
download | cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.gz cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.bz2 cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.lz cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.xz cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.zst cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.zip |
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) : |