summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/being/playerinfo.cpp11
-rw-r--r--src/being/playerinfo.h4
-rw-r--r--src/net/eathena/elementalrecv.cpp3
3 files changed, 17 insertions, 1 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index ff69a0d34..ea1ee8388 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -59,6 +59,7 @@ std::string mRoomName;
Equipment *mEquipment = nullptr;
BeingId mPetBeingId = BeingId_zero;
GuildPositionFlags::Type mGuildPositionFlags = GuildPositionFlags::None;
+BeingId mElementalId = BeingId_zero;
Trading mTrading = Trading_false;
bool mVending = false;
@@ -521,6 +522,16 @@ void setMercenaryBeing(Being *const being)
being->setAttackRange(mMercenary->range);
}
+void setElemental(const BeingId id)
+{
+ mElementalId = id;
+}
+
+BeingId getElementalId()
+{
+ return mElementalId;
+}
+
MercenaryInfo *getMercenary()
{
return mMercenary;
diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h
index d7c1be8fa..2991d0adc 100644
--- a/src/being/playerinfo.h
+++ b/src/being/playerinfo.h
@@ -269,10 +269,14 @@ namespace PlayerInfo
void setHomunculusBeing(Being *const being);
+ void setElemental(const BeingId id);
+
BeingId getHomunculusId();
BeingId getMercenaryId();
+ BeingId getElementalId();
+
void updateMoveAI();
void updateAttackAi(const BeingId targetId,
diff --git a/src/net/eathena/elementalrecv.cpp b/src/net/eathena/elementalrecv.cpp
index 57f78619a..220364acc 100644
--- a/src/net/eathena/elementalrecv.cpp
+++ b/src/net/eathena/elementalrecv.cpp
@@ -59,7 +59,7 @@ void ElementalRecv::processElementalUpdateStatus(Net::MessageIn &msg)
void ElementalRecv::processElementalInfo(Net::MessageIn &msg)
{
- msg.readInt32("elemental id");
+ const BeingId id = msg.readBeingId("elemental id");
PlayerInfo::setStatBase(Attributes::ELEMENTAL_HP,
msg.readInt32("hp"));
PlayerInfo::setStatBase(Attributes::ELEMENTAL_MAX_HP,
@@ -68,6 +68,7 @@ void ElementalRecv::processElementalInfo(Net::MessageIn &msg)
msg.readInt32("sp"));
PlayerInfo::setStatBase(Attributes::ELEMENTAL_MAX_MP,
msg.readInt32("max sp"));
+ PlayerInfo::setElemental(id);
}
} // namespace EAthena