示例#1
0
    void Journal::readRecord (ESM::ESMReader& reader, uint32_t type)
    {
        if (type==ESM::REC_JOUR || type==ESM::REC_JOUR_LEGACY)
        {
            ESM::JournalEntry record;
            record.load (reader);

            if (isThere (record.mTopic, record.mInfo))
                switch (record.mType)
                {
                    case ESM::JournalEntry::Type_Quest:

                        getQuest (record.mTopic).insertEntry (record);
                        break;

                    case ESM::JournalEntry::Type_Journal:

                        mJournal.push_back (record);
                        break;

                    case ESM::JournalEntry::Type_Topic:

                        getTopic (record.mTopic).insertEntry (record);
                        break;
                }
        }
        else if (type==ESM::REC_QUES)
        {
            ESM::QuestState record;
            record.load (reader);

            if (isThere (record.mTopic))
                mQuests.insert (std::make_pair (record.mTopic, record));
        }
    }
示例#2
0
    void Journal::readRecord (ESM::ESMReader& reader, uint32_t type)
    {
        if (type==ESM::REC_JOUR || type==ESM::REC_JOUR_LEGACY)
        {
            ESM::JournalEntry record;
            record.load (reader);

            if (isThere (record.mTopic, record.mInfo))
                switch (record.mType)
                {
                    case ESM::JournalEntry::Type_Quest:

                        getQuest (record.mTopic).insertEntry (record);
                        break;

                    case ESM::JournalEntry::Type_Journal:

                        mJournal.push_back (record);
                        break;

                    case ESM::JournalEntry::Type_Topic:

                        getTopic (record.mTopic).insertEntry (record);
                        break;
                }
        }
        else if (type==ESM::REC_QUES)
        {
            ESM::QuestState record;
            record.load (reader);

            if (isThere (record.mTopic))
            {
                std::pair<TQuestContainer::iterator, bool> result = mQuests.insert (std::make_pair (record.mTopic, record));
                // reapply quest index, this is to handle users upgrading from only
                // Morrowind.esm (no quest states) to Morrowind.esm + Tribunal.esm
                result.first->second.setIndex(record.mState);
            }
        }
    }