1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-11 12:04:29 +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 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 namespace Dialogue
{ {
template <class R> template <class R>
@ -54,7 +40,16 @@ namespace MWScript
Interpreter::Type_Integer index = runtime[0].mInteger; Interpreter::Type_Integer index = runtime[0].mInteger;
runtime.pop(); 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(); const std::list<ESM::DialInfo> orderedInfo = it->mInfoOrder.getOrderedInfo();
for (auto info = orderedInfo.begin(); info != orderedInfo.end(); ++info) 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) else if (type == ESM::Dialogue::Type::Topic)