diff options
Diffstat (limited to 'src/net/eathena/mercenaryhandler.cpp')
-rw-r--r-- | src/net/eathena/mercenaryhandler.cpp | 16 |
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); - } } } |