summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-21 13:44:03 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-21 13:44:03 +0300
commit46d1266f00dfde5d04d7980daea4bab02e77cb69 (patch)
treeadfaa8bdc5b96bf951de15119b1a0854e2eedc9f /src/net
parentba88670fe4b5f4606f80651f6433cc755ab6b6c1 (diff)
downloadplus-46d1266f00dfde5d04d7980daea4bab02e77cb69.tar.gz
plus-46d1266f00dfde5d04d7980daea4bab02e77cb69.tar.bz2
plus-46d1266f00dfde5d04d7980daea4bab02e77cb69.tar.xz
plus-46d1266f00dfde5d04d7980daea4bab02e77cb69.zip
Use MercenaryInfo object for storing mercenary attributes.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/mercenaryhandler.cpp9
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);
+ }
}
}