[General] Change type of refNumIndex & mpNum to unsigned

sol2-server-rewrite
Koncord 7 years ago
parent 2726d94d10
commit 122a30c183

@ -54,22 +54,22 @@ void Actor::setRefId(const std::string &refId)
actor->refId = refId;
}
int Actor::getRefNumIndex() const
unsigned Actor::getRefNumIndex() const
{
return actor->refNumIndex;
}
void Actor::setRefNumIndex(int refNumIndex)
void Actor::setRefNumIndex(unsigned refNumIndex)
{
actor->refNumIndex = refNumIndex;
}
int Actor::getMpNum() const
unsigned Actor::getMpNum() const
{
return actor->mpNum;
}
void Actor::setMpNum(int mpNum)
void Actor::setMpNum(unsigned mpNum)
{
actor->mpNum = mpNum;
}

@ -20,11 +20,11 @@ public:
Actor();
std::string getRefId() const;
void setRefId(const std::string &refId);
int getRefNumIndex() const;
void setRefNumIndex(int refNumIndex);
int getMpNum() const;
void setMpNum(int mpNum);
unsigned getRefNumIndex() const;
void setRefNumIndex(unsigned refNumIndex);
unsigned getMpNum() const;
void setMpNum(unsigned mpNum);
bool doesHavePosition() const; // ????
bool doesHaveStatsDynamic() const; // ????

@ -13,7 +13,7 @@
using namespace std;
Cell::Cell(ESM::Cell cell) : cell(cell)
Cell::Cell(const ESM::Cell &cell) : cell(cell)
{
}
@ -111,7 +111,7 @@ void Cell::readActorList(unsigned char packetID, const mwmp::BaseActorList *newA
}
}
bool Cell::containsActor(int refNumIndex, int mpNum)
bool Cell::containsActor(unsigned refNumIndex, unsigned mpNum)
{
for (const auto &actor : cellActorList.baseActors)
{
@ -121,7 +121,7 @@ bool Cell::containsActor(int refNumIndex, int mpNum)
return false;
}
mwmp::BaseActor *Cell::getActor(int refNumIndex, int mpNum)
mwmp::BaseActor *Cell::getActor(unsigned refNumIndex, unsigned mpNum)
{
for (const auto &actor : cellActorList.baseActors)
{
@ -135,8 +135,8 @@ void Cell::removeActors(const mwmp::BaseActorList &newActorList)
{
for (auto it = cellActorList.baseActors.begin(); it != cellActorList.baseActors.end();)
{
int refNumIndex = (*it)->refNumIndex;
int mpNum = (*it)->mpNum;
unsigned refNumIndex = (*it)->refNumIndex;
unsigned mpNum = (*it)->mpNum;
bool foundActor = false;

@ -20,7 +20,7 @@ class Cell
{
friend class CellController;
public:
Cell(ESM::Cell cell);
Cell(const ESM::Cell &cell);
typedef std::deque<Player*> TPlayers;
typedef TPlayers::const_iterator Iterator;
@ -31,8 +31,8 @@ public:
void removePlayer(Player *player);
void readActorList(unsigned char packetID, const mwmp::BaseActorList *newActorList);
bool containsActor(int refNumIndex, int mpNum);
mwmp::BaseActor *getActor(int refNumIndex, int mpNum);
bool containsActor(unsigned refNumIndex, unsigned mpNum);
mwmp::BaseActor *getActor(unsigned refNumIndex, unsigned mpNum);
void removeActors(const mwmp::BaseActorList &newActorList);
RakNet::RakNetGUID *getAuthority();

@ -89,23 +89,23 @@ void BaseObject::setRefId(const string &refId)
object.refId = refId;
}
int BaseObject::getRefNum() const
unsigned BaseObject::getRefNum() const
{
return object.refNumIndex;
}
void BaseObject::setRefNum(int refNum)
void BaseObject::setRefNum(unsigned refNum)
{
changedBase = true;
object.refNumIndex = refNum;
}
int BaseObject::getMpNum() const
unsigned BaseObject::getMpNum() const
{
return object.mpNum;
}
void BaseObject::setMpNum(int mpNum)
void BaseObject::setMpNum(unsigned mpNum)
{
changedBase = true;
object.mpNum = mpNum;

@ -18,11 +18,11 @@ public:
std::string getRefId() const;
void setRefId(const std::string &refId);
int getRefNum() const;
void setRefNum(int refNum);
unsigned getRefNum() const;
void setRefNum(unsigned refNum);
int getMpNum() const;
void setMpNum(int mpNum);
unsigned getMpNum() const;
void setMpNum(unsigned mpNum);
//void setEventCell(const std::string &cellDescription);

@ -25,7 +25,7 @@ namespace MWWorld
Get the mMpNum (unique multiplayer reference number) of a CellRef
*/
int CellRef::getMpNum() const
unsigned CellRef::getMpNum() const
{
return mCellRef.mMpNum;
}
@ -38,7 +38,7 @@ namespace MWWorld
Set the mMpNum (unique multiplayer reference number) of a CellRef
*/
void CellRef::setMpNum(int index)
void CellRef::setMpNum(unsigned index)
{
mCellRef.mMpNum = index;
}

@ -33,7 +33,7 @@ namespace MWWorld
Get the mMpNum (unique multiplayer reference number) of a CellRef
*/
int getMpNum() const;
unsigned getMpNum() const;
/*
End of tes3mp addition
*/
@ -43,7 +43,7 @@ namespace MWWorld
Set the mMpNum (unique multiplayer reference number) of a CellRef
*/
void setMpNum(int index);
void setMpNum(unsigned index);
/*
End of tes3mp addition
*/

@ -43,7 +43,7 @@ namespace ESM
Keep track of a multiplayer-only number unique to this object
*/
int mMpNum;
unsigned mMpNum;
/*
End of tes3mp addition
*/

@ -26,8 +26,8 @@ namespace mwmp
}
std::string refId;
int refNumIndex;
int mpNum;
unsigned refNumIndex;
unsigned mpNum;
std::string response;
std::string sound;

@ -24,8 +24,8 @@ namespace mwmp
struct WorldObject
{
std::string refId;
int refNumIndex;
int mpNum;
unsigned refNumIndex;
unsigned mpNum;
int count;
int charge;
int goldValue;

@ -37,8 +37,8 @@ namespace mwmp
struct CurrentContainer
{
std::string refId;
int refNumIndex;
int mpNum;
unsigned refNumIndex;
unsigned mpNum;
bool loot;
};

Loading…
Cancel
Save