[Client] Only add valid quests to journal

0.6.1
David Cernat 7 years ago
parent 134dd06d48
commit cf4021a7b5

@ -666,17 +666,27 @@ void LocalPlayer::addJournalItems()
{
for (const auto &journalItem : journalChanges.journalItems)
{
MWWorld::Ptr ptrFound;
if (journalItem.type == JournalItem::ENTRY)
{
MWWorld::Ptr ptrFound = MWBase::Environment::get().getWorld()->searchPtr(journalItem.actorRefId, false);
ptrFound = MWBase::Environment::get().getWorld()->searchPtr(journalItem.actorRefId, false);
if (!ptrFound)
ptrFound = getPlayerPtr();
}
MWBase::Environment::get().getJournal()->addEntry(journalItem.quest, journalItem.index, ptrFound);
try
{
if (journalItem.type == JournalItem::ENTRY)
MWBase::Environment::get().getJournal()->addEntry(journalItem.quest, journalItem.index, ptrFound);
else
MWBase::Environment::get().getJournal()->setJournalIndex(journalItem.quest, journalItem.index);
}
catch (std::exception&)
{
LOG_APPEND(Log::LOG_INFO, "- Ignored addition of invalid journal quest %s", journalItem.quest.c_str());
}
else
MWBase::Environment::get().getJournal()->setJournalIndex(journalItem.quest, journalItem.index);
}
}

@ -15,6 +15,8 @@ namespace mwmp
virtual void Do(PlayerPacket &packet, BasePlayer *player)
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_JOURNAL from server");
if (isRequest())
{
// Entire journal cannot currently be requested from players

Loading…
Cancel
Save