From de7087caf46331b197233581d45b0fd4351746ea Mon Sep 17 00:00:00 2001 From: athile Date: Wed, 30 Jun 2010 11:32:40 -0700 Subject: [PATCH] Move prepareMaster logic into addMaster. Having these separate only introduces the possibility for a bug. --- apps/openmw/engine.cpp | 20 +++++++------------- apps/openmw/engine.hpp | 3 --- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 143f627927..f431e51bdc 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -20,18 +20,6 @@ OMW::Engine::Engine() { } -// adjust name and load bsa - -void OMW::Engine::prepareMaster() -{ - std::string::size_type sep = mMaster.find_last_of ("."); - - if (sep==std::string::npos) - { - mMaster += ".esm"; - } -} - // Load all BSA files in data directory. void OMW::Engine::loadBSA() @@ -79,6 +67,13 @@ void OMW::Engine::addMaster (const std::string& master) { assert (mMaster.empty()); mMaster = master; + + // Append .esm if not already there + std::string::size_type sep = mMaster.find_last_of ("."); + if (sep == std::string::npos) + { + mMaster += ".esm"; + } } // Enables sky rendering @@ -109,7 +104,6 @@ void OMW::Engine::go() addResourcesDirectory (mDataDir / "Meshes"); addResourcesDirectory (mDataDir / "Textures"); - prepareMaster(); loadBSA(); boost::filesystem::path masterPath (mDataDir); diff --git a/apps/openmw/engine.hpp b/apps/openmw/engine.hpp index 8143c3ab83..ae69f52b45 100644 --- a/apps/openmw/engine.hpp +++ b/apps/openmw/engine.hpp @@ -30,9 +30,6 @@ namespace OMW Engine (const Engine&); Engine& operator= (const Engine&); - /// adjust name and load bsa - void prepareMaster(); - /// add resources directory /// \note This function works recursively. void addResourcesDirectory (const boost::filesystem::path& path);