From 6367b4dc0b1cad488c60f6c9c1e69a266464ab60 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 27 Jan 2015 02:21:53 +0100 Subject: [PATCH] Improve INFO struct naming --- apps/esmtool/record.cpp | 2 +- apps/openmw/mwdialogue/journalentry.cpp | 2 +- apps/openmw/mwdialogue/quest.cpp | 2 +- components/esm/loadinfo.hpp | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/esmtool/record.cpp b/apps/esmtool/record.cpp index 7e2124a2f..22dc62323 100644 --- a/apps/esmtool/record.cpp +++ b/apps/esmtool/record.cpp @@ -754,7 +754,7 @@ void Record::print() if (mData.mCell != "") std::cout << " Cell: " << mData.mCell << std::endl; if (mData.mData.mDisposition > 0) - std::cout << " Disposition: " << mData.mData.mDisposition << std::endl; + std::cout << " Disposition/Journal index: " << mData.mData.mDisposition << std::endl; if (mData.mData.mGender != ESM::DialInfo::NA) std::cout << " Gender: " << mData.mData.mGender << std::endl; if (mData.mSound != "") diff --git a/apps/openmw/mwdialogue/journalentry.cpp b/apps/openmw/mwdialogue/journalentry.cpp index b92d7cace..9f07f7b6f 100644 --- a/apps/openmw/mwdialogue/journalentry.cpp +++ b/apps/openmw/mwdialogue/journalentry.cpp @@ -89,7 +89,7 @@ namespace MWDialogue for (ESM::Dialogue::InfoContainer::const_iterator iter (dialogue->mInfo.begin()); iter!=dialogue->mInfo.end(); ++iter) - if (iter->mData.mDisposition==index) /// \todo cleanup info structure + if (iter->mData.mJournalIndex==index) { return iter->mId; } diff --git a/apps/openmw/mwdialogue/quest.cpp b/apps/openmw/mwdialogue/quest.cpp index a699286a1..a9e39b379 100644 --- a/apps/openmw/mwdialogue/quest.cpp +++ b/apps/openmw/mwdialogue/quest.cpp @@ -75,7 +75,7 @@ namespace MWDialogue iter!=dialogue->mInfo.end(); ++iter) if (iter->mId == entry.mInfoId) { - index = iter->mData.mDisposition; /// \todo cleanup info structure + index = iter->mData.mJournalIndex; break; } diff --git a/components/esm/loadinfo.hpp b/components/esm/loadinfo.hpp index 0c0d662a8..59b1af31a 100644 --- a/components/esm/loadinfo.hpp +++ b/components/esm/loadinfo.hpp @@ -32,7 +32,11 @@ struct DialInfo struct DATAstruct { int mUnknown1; - int mDisposition; + union + { + int mDisposition; // Used for dialogue responses + int mJournalIndex; // Used for journal entries + }; signed char mRank; // Rank of NPC signed char mGender; // See Gender enum signed char mPCrank; // Player rank