summaryrefslogtreecommitdiff
path: root/src/net/eathena/mercenaryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-21 15:19:48 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-21 15:19:48 +0300
commit5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232 (patch)
tree2883c9ec84c49ce0519ea3333d396ec535e50de8 /src/net/eathena/mercenaryhandler.cpp
parentba07ca55476c488504a8d8bf9318f15aab687f12 (diff)
downloadmanaplus-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.gz
manaplus-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.bz2
manaplus-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.xz
manaplus-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.zip
Restore mercenary stats if it was respawned.
Diffstat (limited to 'src/net/eathena/mercenaryhandler.cpp')
-rw-r--r--src/net/eathena/mercenaryhandler.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index 0726f5281..d197b6101 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -110,19 +110,15 @@ void MercenaryHandler::processMercenaryInfo(Net::MessageIn &msg)
msg.readInt32("calls");
msg.readInt32("kills");
const int range = msg.readInt16("attack range");
- if (dstBeing)
+ if (dstBeing && localPlayer)
{
- dstBeing->setName(name);
+ MercenaryInfo *const mercenary = new MercenaryInfo;
+ mercenary->id = dstBeing->getId();
+ mercenary->name = name;
+ PlayerInfo::setMercenary(mercenary);
+ PlayerInfo::setMercenaryBeing(dstBeing);
dstBeing->setLevel(level);
dstBeing->setAttackRange(range);
- dstBeing->setOwner(localPlayer);
- if (localPlayer)
- {
- MercenaryInfo *const mercenary = new MercenaryInfo;
- mercenary->id = dstBeing->getId();
- mercenary->name = name;
- PlayerInfo::setMercenary(mercenary);
- }
}
}