summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/playerrecv.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/net/eathena/playerrecv.cpp b/src/net/eathena/playerrecv.cpp
index af35c2248..e9dbeb74d 100644
--- a/src/net/eathena/playerrecv.cpp
+++ b/src/net/eathena/playerrecv.cpp
@@ -24,6 +24,7 @@
#include "configuration.h"
#include "notifymanager.h"
+#include "party.h"
#include "being/beingflag.h"
#include "being/localplayer.h"
@@ -40,6 +41,8 @@
#include "net/messagein.h"
+#include "net/ea/eaprotocol.h"
+
#include "debug.h"
namespace EAthena
@@ -231,10 +234,26 @@ void PlayerRecv::processPlayerHeal(Net::MessageIn &msg)
const int type = msg.readInt16("var id");
const int amount = msg.readInt16("value");
- if (type == 5)
+ if (type == Ea::HP)
+ {
+ const int base = PlayerInfo::getAttribute(Attributes::HP) + amount;
+ PlayerInfo::setAttribute(Attributes::HP, base);
+ if (localPlayer->isInParty() && Party::getParty(1))
+ {
+ PartyMember *const m = Party::getParty(1)
+ ->getMember(localPlayer->getId());
+ if (m)
+ {
+ m->setHp(base);
+ m->setMaxHp(PlayerInfo::getAttribute(Attributes::MAX_HP));
+ }
+ }
localPlayer->addHpMessage(amount);
- else if (type == 7)
+ }
+ else if (type == Ea::MP)
+ {
localPlayer->addSpMessage(amount);
+ }
}
void PlayerRecv::processPlayerSkillMessage(Net::MessageIn &msg)