[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; actor->refId = refId;
} }
int Actor::getRefNumIndex() const unsigned Actor::getRefNumIndex() const
{ {
return actor->refNumIndex; return actor->refNumIndex;
} }
void Actor::setRefNumIndex(int refNumIndex) void Actor::setRefNumIndex(unsigned refNumIndex)
{ {
actor->refNumIndex = refNumIndex; actor->refNumIndex = refNumIndex;
} }
int Actor::getMpNum() const unsigned Actor::getMpNum() const
{ {
return actor->mpNum; return actor->mpNum;
} }
void Actor::setMpNum(int mpNum) void Actor::setMpNum(unsigned mpNum)
{ {
actor->mpNum = mpNum; actor->mpNum = mpNum;
} }

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

@ -13,7 +13,7 @@
using namespace std; 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) for (const auto &actor : cellActorList.baseActors)
{ {
@ -121,7 +121,7 @@ bool Cell::containsActor(int refNumIndex, int mpNum)
return false; return false;
} }
mwmp::BaseActor *Cell::getActor(int refNumIndex, int mpNum) mwmp::BaseActor *Cell::getActor(unsigned refNumIndex, unsigned mpNum)
{ {
for (const auto &actor : cellActorList.baseActors) 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();) for (auto it = cellActorList.baseActors.begin(); it != cellActorList.baseActors.end();)
{ {
int refNumIndex = (*it)->refNumIndex; unsigned refNumIndex = (*it)->refNumIndex;
int mpNum = (*it)->mpNum; unsigned mpNum = (*it)->mpNum;
bool foundActor = false; bool foundActor = false;

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save