diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-21 15:19:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-21 15:19:48 +0300 |
commit | 5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232 (patch) | |
tree | 2883c9ec84c49ce0519ea3333d396ec535e50de8 /src/net/eathena/beinghandler.cpp | |
parent | ba07ca55476c488504a8d8bf9318f15aab687f12 (diff) | |
download | manaverse-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.gz manaverse-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.bz2 manaverse-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.xz manaverse-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.zip |
Restore mercenary stats if it was respawned.
Diffstat (limited to 'src/net/eathena/beinghandler.cpp')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index e2617dc98..9707475da 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -28,6 +28,8 @@ #include "party.h" #include "being/localplayer.h" +#include "being/mercenaryinfo.h" +#include "being/playerinfo.h" #include "input/keyboardconfig.h" @@ -325,7 +327,14 @@ Being *BeingHandler::createBeing2(const int id, if (job == 45 && beingType == BeingType::NPC_EVENT) type = ActorType::Portal; - return actorManager->createBeing(id, type, job); + Being *const being = actorManager->createBeing(id, type, job); + if (beingType == BeingType::MERSOL) + { + MercenaryInfo *const info = PlayerInfo::getMercenary(); + if (info && info->id == id) + PlayerInfo::setMercenaryBeing(being); + } + return being; } void BeingHandler::undress(Being *const being) const |