summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-24 21:40:11 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-24 21:40:11 +0300
commit94a3b513dda2189a49f8f5e0d131b9f644d60cef (patch)
treee2027f225f9a14cb935df099e74eec5c190c6d39 /src/being
parent73c360768c4d0a9013073fb86123eab858ff79d7 (diff)
downloadplus-94a3b513dda2189a49f8f5e0d131b9f644d60cef.tar.gz
plus-94a3b513dda2189a49f8f5e0d131b9f644d60cef.tar.bz2
plus-94a3b513dda2189a49f8f5e0d131b9f644d60cef.tar.xz
plus-94a3b513dda2189a49f8f5e0d131b9f644d60cef.zip
eathena: add packet SMSG_HOMUNCULUS_DATA 0x0230.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/playerinfo.cpp22
-rw-r--r--src/being/playerinfo.h7
2 files changed, 29 insertions, 0 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index 6c4e1c92d..4f40b2c58 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -26,6 +26,7 @@
#include "inventory.h"
#include "being/attributes.h"
+#include "being/homunculusinfo.h"
#include "being/localplayer.h"
#include "being/mercenaryinfo.h"
#include "being/petinfo.h"
@@ -57,6 +58,7 @@ int mCharId = 0;
Inventory *mInventory = nullptr;
Equipment *mEquipment = nullptr;
MercenaryInfo *mMercenary = nullptr;
+HomunculusInfo *mHomunculus = nullptr;
PetInfo *mPet = nullptr;
bool mTrading = false;
@@ -511,4 +513,24 @@ PetInfo *getPet()
return mPet;
}
+void setHomunculus(HomunculusInfo *const info)
+{
+ if (mHomunculus)
+ delete mHomunculus;
+ mHomunculus = info;
+}
+
+void setHomunculusBeing(Being *const being)
+{
+ if (!being || !mPet)
+ return;
+ being->setName(mHomunculus->name);
+ being->setOwner(localPlayer);
+}
+
+HomunculusInfo *getHomunculus()
+{
+ return mHomunculus;
+}
+
} // namespace PlayerInfo
diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h
index 23fb41731..aa2251bbe 100644
--- a/src/being/playerinfo.h
+++ b/src/being/playerinfo.h
@@ -63,6 +63,7 @@ class FloorItem;
class Inventory;
class Item;
+struct HomunculusInfo;
struct MercenaryInfo;
struct PetInfo;
@@ -249,6 +250,12 @@ namespace PlayerInfo
void setPet(PetInfo *const info);
void setPetBeing(Being *const being);
+
+ HomunculusInfo *getHomunculus();
+
+ void setHomunculus(HomunculusInfo *const info);
+
+ void setHomunculusBeing(Being *const being);
} // namespace PlayerInfo
#endif // BEING_PLAYERINFO_H