diff --git a/apps/openmw/mwworld/cellref.cpp b/apps/openmw/mwworld/cellref.cpp index 72ee56e6a..952d1cde9 100644 --- a/apps/openmw/mwworld/cellref.cpp +++ b/apps/openmw/mwworld/cellref.cpp @@ -20,6 +20,32 @@ namespace MWWorld mCellRef.mRefNum.unset(); } + /* + Start of tes3mp addition + + Get the mMpNum (unique multiplayer reference number) of a CellRef + */ + int CellRef::getMpNum() const + { + return mCellRef.mMpNum; + } + /* + End of tes3mp addition + */ + + /* + Start of tes3mp addition + + Set the mMpNum (unique multiplayer reference number) of a CellRef + */ + void CellRef::setMpNum(int index) + { + mCellRef.mMpNum = index; + } + /* + End of tes3mp addition + */ + std::string CellRef::getRefId() const { return mCellRef.mRefID; diff --git a/apps/openmw/mwworld/cellref.hpp b/apps/openmw/mwworld/cellref.hpp index 7e27e6ef3..790b589bc 100644 --- a/apps/openmw/mwworld/cellref.hpp +++ b/apps/openmw/mwworld/cellref.hpp @@ -28,6 +28,26 @@ namespace MWWorld // Set RefNum to its default state. void unsetRefNum(); + /* + Start of tes3mp addition + + Get the mMpNum (unique multiplayer reference number) of a CellRef + */ + int getMpNum() const; + /* + End of tes3mp addition + */ + + /* + Start of tes3mp addition + + Set the mMpNum (unique multiplayer reference number) of a CellRef + */ + void setMpNum(int index); + /* + End of tes3mp addition + */ + /// Does the RefNum have a content file? bool hasContentFile() const; diff --git a/components/esm/cellref.cpp b/components/esm/cellref.cpp index e41201d6e..cdf2a87ed 100644 --- a/components/esm/cellref.cpp +++ b/components/esm/cellref.cpp @@ -213,6 +213,16 @@ void ESM::CellRef::blank() mPos.pos[i] = 0; mPos.rot[i] = 0; } + + /* + Start of tes3mp addition + + Set the mMpNum (unique multiplayer reference number) to 0 by default + */ + mMpNum = 0; + /* + End of tes3mp addition + */ } bool ESM::operator== (const RefNum& left, const RefNum& right) diff --git a/components/esm/cellref.hpp b/components/esm/cellref.hpp index f14617531..a8a90357a 100644 --- a/components/esm/cellref.hpp +++ b/components/esm/cellref.hpp @@ -38,6 +38,16 @@ namespace ESM // Note: Currently unused for items in containers RefNum mRefNum; + /* + Start of tes3mp addition + + Keep track of a multiplayer-only number unique to this object + */ + int mMpNum; + /* + End of tes3mp addition + */ + std::string mRefID; // ID of object being referenced float mScale; // Scale applied to mesh