diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-29 14:30:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-29 14:30:20 +0300 |
commit | 0f9ec2061c4ad6157c3186f1cab9c4d8558980b5 (patch) | |
tree | 6259593b8436178ad8d981a96a8fd71eab9e04cc /src/being/playerinfo.cpp | |
parent | 01773c71a4698c6f01fe70d864f922bda65506cb (diff) | |
download | plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.gz plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.bz2 plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.xz plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.zip |
Add strong typed int type BeingId.
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r-- | src/being/playerinfo.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index 576d6575d..f11b6fe82 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -62,7 +62,7 @@ PetInfo *mPet = nullptr; std::string mRoomName; #endif Equipment *mEquipment = nullptr; -int mPetBeingId = 0; +BeingId mPetBeingId = BeingId_zero; GuildPositionFlags::Type mGuildPositionFlags = GuildPositionFlags::None; Trading mTrading = Trading_false; @@ -399,7 +399,7 @@ void deinit() #ifdef EATHENA_SUPPORT delete2(mMercenary); #endif - mPetBeingId = 0; + mPetBeingId = BeingId_zero; } void loadData() @@ -412,7 +412,7 @@ void loadData() void clear() { mData.mSkills.clear(); - mPetBeingId = 0; + mPetBeingId = BeingId_zero; } bool isTalking() @@ -515,7 +515,7 @@ void setPetBeing(Being *const being) if (being) mPetBeingId = being->getId(); else - mPetBeingId = 0; + mPetBeingId = BeingId_zero; if (!being || !mPet) return; being->setName(mPet->name); @@ -528,7 +528,7 @@ PetInfo *getPet() return mPet; } -int getPetBeingId() +BeingId getPetBeingId() { return mPetBeingId; } @@ -553,14 +553,14 @@ HomunculusInfo *getHomunculus() return mHomunculus; } -int getHomunculusId() +BeingId getHomunculusId() { - return mHomunculus ? mHomunculus->id : 0; + return mHomunculus ? mHomunculus->id : BeingId_zero; } -int getMercenaryId() +BeingId getMercenaryId() { - return mMercenary ? mMercenary->id : 0; + return mMercenary ? mMercenary->id : BeingId_zero; } void updateMoveAI() @@ -571,7 +571,8 @@ void updateMoveAI() homunculusHandler->moveToMaster(); } -void updateAttackAi(const int targetId, const Keep keep) +void updateAttackAi(const BeingId targetId, + const Keep keep) { if (mMercenary) mercenaryHandler->attack(targetId, keep); |