From 850c4e74f8c5daf218beaa4f948df2c9c8ded42e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 8 Mar 2016 20:24:01 +0300 Subject: Fix packet SMSG_PLAYER_HEAL. Now it also update hp/sp. --- src/net/eathena/playerrecv.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/net/eathena/playerrecv.cpp') 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) -- cgit v1.2.3-60-g2f50