diff options
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 1 | ||||
-rw-r--r-- | src/being/playerinfo.cpp | 15 | ||||
-rw-r--r-- | src/being/playerinfo.h | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 4a3e4d0cb..e8ab55736 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -281,6 +281,7 @@ Being::~Being() { if (mType == ActorType::LocalPet) mOwner->unassignPet(this); + mOwner = nullptr; } FOR_EACH (std::vector<Being*>::iterator, it, mPets) diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index 23a55f6fe..6b3bb2703 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -64,7 +64,7 @@ Equipment *mEquipment = nullptr; MercenaryInfo *mMercenary = nullptr; HomunculusInfo *mHomunculus = nullptr; PetInfo *mPet = nullptr; -Being *mPetBeing = nullptr; +int mPetBeingId = 0; GuildPositionFlags::Type mGuildPositionFlags = GuildPositionFlags::None; bool mTrading = false; @@ -395,7 +395,7 @@ void deinit() { clearInventory(); delete2(mMercenary); - mPetBeing = nullptr; + mPetBeingId = 0; } void loadData() @@ -408,7 +408,7 @@ void loadData() void clear() { mData.mSkills.clear(); - mPetBeing = nullptr; + mPetBeingId = 0; } bool isTalking() @@ -508,7 +508,10 @@ void setPet(PetInfo *const info) void setPetBeing(Being *const being) { - mPetBeing = being; + if (being) + mPetBeingId = being->getId(); + else + mPetBeingId = 0; if (!being || !mPet) return; being->setName(mPet->name); @@ -521,9 +524,9 @@ PetInfo *getPet() return mPet; } -Being *getPetBeing() +int getPetBeingId() { - return mPetBeing; + return mPetBeingId; } void setHomunculus(HomunculusInfo *const info) diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h index d8272dca4..54c578163 100644 --- a/src/being/playerinfo.h +++ b/src/being/playerinfo.h @@ -251,7 +251,7 @@ namespace PlayerInfo void setPetBeing(Being *const being); - Being *getPetBeing(); + int getPetBeingId(); HomunculusInfo *getHomunculus(); |