1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-07 18:04:34 +00:00

Revert shared addJournalEntry

This commit is contained in:
Aussiemon 2025-05-15 12:32:05 -06:00 committed by Aussiemon
parent 34194f9c08
commit 4b98520266

View file

@ -22,20 +22,6 @@
namespace MWScript
{
static void addJournalEntry(ESM::RefId quest, int index, MWWorld::Ptr ptr)
{
// Invoking Journal with a non-existing index is allowed, and triggers no errors. Seriously? :(
try
{
MWBase::Environment::get().getJournal()->addEntry(quest, index, ptr);
}
catch (...)
{
if (MWBase::Environment::get().getJournal()->getJournalIndex(quest) < index)
MWBase::Environment::get().getJournal()->setJournalIndex(quest, index);
}
}
namespace Dialogue
{
template <class R>
@ -54,7 +40,16 @@ namespace MWScript
Interpreter::Type_Integer index = runtime[0].mInteger;
runtime.pop();
addJournalEntry(quest, index, ptr);
// Invoking Journal with a non-existing index is allowed, and triggers no errors. Seriously? :(
try
{
MWBase::Environment::get().getJournal()->addEntry(quest, index, ptr);
}
catch (...)
{
if (MWBase::Environment::get().getJournal()->getJournalIndex(quest) < index)
MWBase::Environment::get().getJournal()->setJournalIndex(quest, index);
}
}
};
@ -105,7 +100,7 @@ namespace MWScript
const std::list<ESM::DialInfo> orderedInfo = it->mInfoOrder.getOrderedInfo();
for (auto info = orderedInfo.begin(); info != orderedInfo.end(); ++info)
{
addJournalEntry(quest, info->mData.mJournalIndex, ptr);
MWBase::Environment::get().getJournal()->addEntry(quest, info->mData.mJournalIndex, ptr);
}
}
else if (type == ESM::Dialogue::Type::Topic)