1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-13 12:40:04 +00:00

Allow invoking Journal instruction with non-existing index

This is used by the MG_EscortScholar1 quest.
This commit is contained in:
scrawl 2014-05-21 14:18:14 +02:00
parent 2f6d400c62
commit 3a7e2f8bb5

View File

@ -34,8 +34,16 @@ namespace MWScript
Interpreter::Type_Integer index = runtime[0].mInteger; Interpreter::Type_Integer index = runtime[0].mInteger;
runtime.pop(); runtime.pop();
// Invoking Journal with a non-existing index is allowed, and triggers no errors. Seriously? :(
try
{
MWBase::Environment::get().getJournal()->addEntry (quest, index); MWBase::Environment::get().getJournal()->addEntry (quest, index);
} }
catch (...)
{
MWBase::Environment::get().getJournal()->setJournalIndex(quest, index);
}
}
}; };
class OpSetJournalIndex : public Interpreter::Opcode0 class OpSetJournalIndex : public Interpreter::Opcode0