From bf92d5cde9e501e2bfcc081707968938a79076a0 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 3 Mar 2015 13:04:57 +0100 Subject: [PATCH] removed redundant mScript field in ESM::StartScript --- apps/esmtool/record.cpp | 2 +- apps/openmw/mwscript/globalscripts.cpp | 2 +- apps/openmw/mwworld/store.hpp | 13 ------------- components/esm/loadsscr.cpp | 4 ++-- components/esm/loadsscr.hpp | 2 +- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/apps/esmtool/record.cpp b/apps/esmtool/record.cpp index 97b0635fe..6fd4b80fb 100644 --- a/apps/esmtool/record.cpp +++ b/apps/esmtool/record.cpp @@ -1253,7 +1253,7 @@ void Record::print() template<> void Record::print() { - std::cout << "Start Script: " << mData.mScript << std::endl; + std::cout << "Start Script: " << mData.mId << std::endl; std::cout << "Start Data: " << mData.mData << std::endl; } diff --git a/apps/openmw/mwscript/globalscripts.cpp b/apps/openmw/mwscript/globalscripts.cpp index 92fd51d87..a6ad2cc11 100644 --- a/apps/openmw/mwscript/globalscripts.cpp +++ b/apps/openmw/mwscript/globalscripts.cpp @@ -100,7 +100,7 @@ namespace MWScript mStore.get().begin(); iter != mStore.get().end(); ++iter) { - scripts.push_back (iter->mScript); + scripts.push_back (iter->mId); } // add scripts diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index 50dd37ac0..a887272c5 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -364,19 +364,6 @@ namespace MWWorld inserted.first->second = scpt; } - template <> - inline void Store::load(ESM::ESMReader &esm, const std::string &id) { - ESM::StartScript s; - s.load(esm); - s.mId = Misc::StringUtils::toLower(s.mScript); - - std::pair inserted = mStatic.insert(std::make_pair(s.mId, s)); - if (inserted.second) - mShared.push_back(&inserted.first->second); - else - inserted.first->second = s; - } - template <> class Store : public StoreBase { diff --git a/components/esm/loadsscr.cpp b/components/esm/loadsscr.cpp index 816075b7e..9b02b51c9 100644 --- a/components/esm/loadsscr.cpp +++ b/components/esm/loadsscr.cpp @@ -23,7 +23,7 @@ namespace ESM hasData = true; break; case ESM::FourCC<'N','A','M','E'>::value: - mScript = esm.getHString(); + mId = esm.getHString(); hasName = true; break; default: @@ -38,7 +38,7 @@ namespace ESM void StartScript::save(ESMWriter &esm) const { esm.writeHNString("DATA", mData); - esm.writeHNString("NAME", mScript); + esm.writeHNString("NAME", mId); } } diff --git a/components/esm/loadsscr.hpp b/components/esm/loadsscr.hpp index d09ad883e..954a4a2b6 100644 --- a/components/esm/loadsscr.hpp +++ b/components/esm/loadsscr.hpp @@ -22,7 +22,7 @@ struct StartScript static unsigned int sRecordId; std::string mData; - std::string mId, mScript; + std::string mId; // Load a record and add it to the list void load(ESMReader &esm);