diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index c5bfbd09b..ac72013ff 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -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); } } diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp index ee104cc85..93c982b62 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerJournal.hpp @@ -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