From 382e4efcd1a7151a168657b0c731e9e758e7008d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Dec 2014 17:16:48 +0300 Subject: Move processPartyUpdateHp from ea namespace into tmwa. --- src/net/tmwa/partyhandler.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/net/tmwa/partyhandler.cpp') diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 3e16fc08a..9cfd8986c 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -435,4 +435,27 @@ void PartyHandler::processPartyMove(Net::MessageIn &msg) } } +void PartyHandler::processPartyUpdateHp(Net::MessageIn &msg) +{ + const int id = msg.readInt32("id"); + const int hp = msg.readInt16("hp"); + const int maxhp = msg.readInt16("max hp"); + PartyMember *m = nullptr; + if (Ea::taParty) + m = Ea::taParty->getMember(id); + if (m) + { + m->setHp(hp); + m->setMaxHp(maxhp); + } + + // The server only sends this when the member is in range, so + // lets make sure they get the party hilight. + if (actorManager && Ea::taParty) + { + if (Being *const b = actorManager->findBeing(id)) + b->setParty(Ea::taParty); + } +} + } // namespace TmwAthena -- cgit v1.2.3-70-g09d2