Allow setting a journal index even if there's no related journal entry

This is used by the MV_SlaveMule quest.
This commit is contained in:
scrawl 2014-05-18 07:37:32 +02:00
parent e1458453f3
commit 5fc2b1a41b

View file

@ -45,7 +45,6 @@ namespace MWDialogue
const ESM::Dialogue *dialogue = const ESM::Dialogue *dialogue =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (mTopic); MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (mTopic);
bool found=false;
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin()); for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter) iter!=dialogue->mInfo.end(); ++iter)
if (iter->mData.mDisposition==index && iter->mQuestStatus!=ESM::DialInfo::QS_Name) if (iter->mData.mDisposition==index && iter->mQuestStatus!=ESM::DialInfo::QS_Name)
@ -55,14 +54,11 @@ namespace MWDialogue
else if (iter->mQuestStatus==ESM::DialInfo::QS_Restart) else if (iter->mQuestStatus==ESM::DialInfo::QS_Restart)
mFinished = false; mFinished = false;
found = true;
// Don't return here. Quest status may actually be in a different info record, since we don't merge these (yet?) // Don't return here. Quest status may actually be in a different info record, since we don't merge these (yet?)
} }
if (found) // The index must be set even if no related journal entry was found
mIndex = index; mIndex = index;
else
throw std::runtime_error ("unknown journal index for topic " + mTopic);
} }
bool Quest::isFinished() const bool Quest::isFinished() const