summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/being/mercenaryinfo.h8
-rw-r--r--src/being/playerinfo.cpp2
-rw-r--r--src/net/eathena/mercenaryhandler.cpp4
3 files changed, 10 insertions, 4 deletions
diff --git a/src/being/mercenaryinfo.h b/src/being/mercenaryinfo.h
index 6bb9fd84d..9aa1bee66 100644
--- a/src/being/mercenaryinfo.h
+++ b/src/being/mercenaryinfo.h
@@ -26,14 +26,18 @@
struct MercenaryInfo final
{
MercenaryInfo() :
+ name(),
id(0),
- name()
+ level(0),
+ range(0)
{ }
A_DELETE_COPY(MercenaryInfo)
- int id;
std::string name;
+ int id;
+ int level;
+ int range;
};
#endif // BEING_MERCENARYINFO_H
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index ba36d59a3..e23c4c1b5 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -479,6 +479,8 @@ void setMercenaryBeing(Being *const being)
return;
being->setName(mMercenary->name);
being->setOwner(localPlayer);
+ being->setLevel(mMercenary->level);
+ being->setAttackRange(mMercenary->range);
}
MercenaryInfo *getMercenary()
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index d197b6101..702319c01 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -115,10 +115,10 @@ void MercenaryHandler::processMercenaryInfo(Net::MessageIn &msg)
MercenaryInfo *const mercenary = new MercenaryInfo;
mercenary->id = dstBeing->getId();
mercenary->name = name;
+ mercenary->level = level;
+ mercenary->range = range;
PlayerInfo::setMercenary(mercenary);
PlayerInfo::setMercenaryBeing(dstBeing);
- dstBeing->setLevel(level);
- dstBeing->setAttackRange(range);
}
}