diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-21 13:44:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-21 13:44:03 +0300 |
commit | 46d1266f00dfde5d04d7980daea4bab02e77cb69 (patch) | |
tree | adfaa8bdc5b96bf951de15119b1a0854e2eedc9f /src/net | |
parent | ba88670fe4b5f4606f80651f6433cc755ab6b6c1 (diff) | |
download | manaplus-46d1266f00dfde5d04d7980daea4bab02e77cb69.tar.gz manaplus-46d1266f00dfde5d04d7980daea4bab02e77cb69.tar.bz2 manaplus-46d1266f00dfde5d04d7980daea4bab02e77cb69.tar.xz manaplus-46d1266f00dfde5d04d7980daea4bab02e77cb69.zip |
Use MercenaryInfo object for storing mercenary attributes.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/mercenaryhandler.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp index 424bc337c..a614cf429 100644 --- a/src/net/eathena/mercenaryhandler.cpp +++ b/src/net/eathena/mercenaryhandler.cpp @@ -25,6 +25,7 @@ #include "being/being.h" #include "being/localplayer.h" +#include "being/mercenaryinfo.h" #include "being/playerinfo.h" #include "gui/windows/skilldialog.h" @@ -111,8 +112,14 @@ void MercenaryHandler::processMercenaryInfo(Net::MessageIn &msg) dstBeing->setName(name); dstBeing->setLevel(level); dstBeing->setAttackRange(range); + dstBeing->setOwner(localPlayer); if (localPlayer) - localPlayer->setMercenary(dstBeing->getId()); + { + MercenaryInfo *const mercenary = new MercenaryInfo; + mercenary->id = dstBeing->getId(); + mercenary->name = name; + PlayerInfo::setMercenary(mercenary); + } } } |