[Client] Add a multiplayer object index and matching methods to CellRef

pull/199/head
David Cernat 8 years ago
parent d242f3790f
commit 06acd3cbc4

@ -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;

@ -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;

@ -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)

@ -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

Loading…
Cancel
Save