From 0189dbf9163bb151746f6bab4def7a1e279500c0 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 18 May 2017 10:32:23 +0300 Subject: [PATCH] [General] Make JournalItem consistent with other packet structs --- apps/openmw/mwmp/LocalPlayer.cpp | 9 +++++---- components/openmw-mp/Base/BasePlayer.hpp | 4 +++- .../openmw-mp/Packets/Player/PacketPlayerJournal.cpp | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 3a7ee1a3d..e18d32683 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -671,8 +671,8 @@ void LocalPlayer::addJournalItems() if (!ptrCellStore) continue; - MWWorld::Ptr ptrFound = ptrCellStore->searchExact(journalItem.actorCellRef.mRefID, - journalItem.actorCellRef.mRefNum.mIndex, journalItem.actorCellRef.mMpNum); + MWWorld::Ptr ptrFound = ptrCellStore->searchExact(journalItem.actorRefId, + journalItem.actorRefNumIndex, journalItem.actorMpNum); if (!ptrFound) { @@ -1092,8 +1092,9 @@ void LocalPlayer::sendJournalEntry(const std::string& quest, int index, const MW if (actor.mCell != nullptr) journalItem.actorCell = *actor.mCell->getCell(); - journalItem.actorCellRef.mRefID = actor.getCellRef().getRefId(); - journalItem.actorCellRef.mRefNum = actor.getCellRef().getRefNum(); + journalItem.actorRefId = actor.getCellRef().getRefId(); + journalItem.actorRefNumIndex = actor.getCellRef().getRefNum().mIndex; + journalItem.actorMpNum = actor.getCellRef().getMpNum(); journalChanges.journalItems.push_back(journalItem); diff --git a/components/openmw-mp/Base/BasePlayer.hpp b/components/openmw-mp/Base/BasePlayer.hpp index 883c89967..ed87bd46e 100644 --- a/components/openmw-mp/Base/BasePlayer.hpp +++ b/components/openmw-mp/Base/BasePlayer.hpp @@ -49,7 +49,9 @@ namespace mwmp }; ESM::Cell actorCell; - ESM::CellRef actorCellRef; + std::string actorRefId; + int actorRefNumIndex; + int actorMpNum; int type; // 0 - An entire entry, 1 - An index }; diff --git a/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp b/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp index 3df36d52e..7dd82f686 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerJournal.cpp @@ -33,8 +33,9 @@ void PacketPlayerJournal::Packet(RakNet::BitStream *bs, bool send) if (journalItem.type == JournalItem::ENTRY) { - RW(journalItem.actorCellRef.mRefID, send); - RW(journalItem.actorCellRef.mRefNum.mIndex, send); + RW(journalItem.actorRefId, send); + RW(journalItem.actorRefNumIndex, send); + RW(journalItem.actorMpNum, send); RW(journalItem.actorCell.mData.mFlags, send); RW(journalItem.actorCell.mData.mX, send); RW(journalItem.actorCell.mData.mY, send);