summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/being/being.cpp4
-rw-r--r--src/net/eathena/mercenaryhandler.cpp17
2 files changed, 15 insertions, 6 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index f52371d78..40d20fe98 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -221,7 +221,7 @@ Being::Being(const int id,
setMap(map);
setSubtype(subtype, 0);
- if (mType == ActorType::Player)
+ if (mType == ActorType::Player || mType == ActorType::Mercenary)
mShowName = config.getBoolValue("visiblenames");
else if (mType != ActorType::Npc)
mGotComment = true;
@@ -838,7 +838,7 @@ void Being::setName(const std::string &name)
{
mName = name;
- if (mType == ActorType::Player && getShowName())
+ if (getShowName())
showName();
}
}
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index b48a6b39b..0000d0139 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -20,8 +20,11 @@
#include "net/eathena/mercenaryhandler.h"
+#include "actormanager.h"
#include "logger.h"
+#include "being/being.h"
+
#include "net/ea/eaprotocol.h"
#include "net/eathena/messageout.h"
@@ -79,7 +82,7 @@ void MercenaryHandler::processMercenaryUpdate(Net::MessageIn &msg)
void MercenaryHandler::processMercenaryInfo(Net::MessageIn &msg)
{
// +++ need create if need mercenary being and update stats
- msg.readInt32("account id"); // owner
+ Being *const dstBeing = actorManager->findBeing(msg.readInt32("being id"));
msg.readInt16("atk");
msg.readInt16("matk");
msg.readInt16("hit");
@@ -88,8 +91,8 @@ void MercenaryHandler::processMercenaryInfo(Net::MessageIn &msg)
msg.readInt16("mdef");
msg.readInt16("flee");
msg.readInt16("attack speed");
- msg.readString(24, "name");
- msg.readInt16("level");
+ const std::string name = msg.readString(24, "name");
+ const int level = msg.readInt16("level");
msg.readInt32("hp");
msg.readInt32("max hp");
msg.readInt32("sp");
@@ -98,7 +101,13 @@ void MercenaryHandler::processMercenaryInfo(Net::MessageIn &msg)
msg.readInt16("faith");
msg.readInt32("calls");
msg.readInt32("kills");
- msg.readInt16("attack range");
+ const int range = msg.readInt16("attack range");
+ if (dstBeing)
+ {
+ dstBeing->setName(name);
+ dstBeing->setLevel(level);
+ dstBeing->setAttackRange(range);
+ }
}
void MercenaryHandler::processMercenarySkills(Net::MessageIn &msg)