summaryrefslogtreecommitdiff
path: root/src/being/playerinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r--src/being/playerinfo.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index e23c4c1b5..6c4e1c92d 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -28,6 +28,7 @@
#include "being/attributes.h"
#include "being/localplayer.h"
#include "being/mercenaryinfo.h"
+#include "being/petinfo.h"
#include "itemsoundmanager.h"
@@ -56,6 +57,7 @@ int mCharId = 0;
Inventory *mInventory = nullptr;
Equipment *mEquipment = nullptr;
MercenaryInfo *mMercenary = nullptr;
+PetInfo *mPet = nullptr;
bool mTrading = false;
int mLevelProgress = 0;
@@ -488,4 +490,25 @@ MercenaryInfo *getMercenary()
return mMercenary;
}
+void setPet(PetInfo *const info)
+{
+ if (mPet)
+ delete mPet;
+ mPet = info;
+}
+
+void setPetBeing(Being *const being)
+{
+ if (!being || !mPet)
+ return;
+ being->setName(mPet->name);
+ being->setOwner(localPlayer);
+ being->setLevel(mPet->level);
+}
+
+PetInfo *getPet()
+{
+ return mPet;
+}
+
} // namespace PlayerInfo