summaryrefslogtreecommitdiff
path: root/src/being/playerinfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-23 00:42:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-23 00:42:38 +0300
commit2acd4cd73813e8cd0bf6d662e10e34af59cfac99 (patch)
tree2fa62d81b7849510df10a9efb8cec8b3384fa12b /src/being/playerinfo.cpp
parentc4122f537ce74b55c6e465d2020f17b791b278a4 (diff)
downloadmanaplus-2acd4cd73813e8cd0bf6d662e10e34af59cfac99.tar.gz
manaplus-2acd4cd73813e8cd0bf6d662e10e34af59cfac99.tar.bz2
manaplus-2acd4cd73813e8cd0bf6d662e10e34af59cfac99.tar.xz
manaplus-2acd4cd73813e8cd0bf6d662e10e34af59cfac99.zip
eathena: use petinfo for loading and storing data about pet.
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