forked from mirror/openmw-tes3mp
[Client] Only add valid quests to journal
This commit is contained in:
parent
134dd06d48
commit
cf4021a7b5
2 changed files with 17 additions and 5 deletions
|
@ -666,18 +666,28 @@ 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LocalPlayer::addTopics()
|
||||
|
|
|
@ -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…
Reference in a new issue