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/being/playerinfo.cpp | |
parent | ba07ca55476c488504a8d8bf9318f15aab687f12 (diff) | |
download | manaplus-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.gz manaplus-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.bz2 manaplus-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.xz manaplus-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.zip |
Restore mercenary stats if it was respawned.
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r-- | src/being/playerinfo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index 993c4d8a6..ba36d59a3 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -26,6 +26,7 @@ #include "inventory.h" #include "being/attributes.h" +#include "being/localplayer.h" #include "being/mercenaryinfo.h" #include "itemsoundmanager.h" @@ -472,6 +473,14 @@ void setMercenary(MercenaryInfo *const info) mMercenary = info; } +void setMercenaryBeing(Being *const being) +{ + if (!being || !mMercenary) + return; + being->setName(mMercenary->name); + being->setOwner(localPlayer); +} + MercenaryInfo *getMercenary() { return mMercenary; |