summaryrefslogtreecommitdiff
path: root/src/being/playerinfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-21 15:19:48 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-21 15:19:48 +0300
commit5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232 (patch)
tree2883c9ec84c49ce0519ea3333d396ec535e50de8 /src/being/playerinfo.cpp
parentba07ca55476c488504a8d8bf9318f15aab687f12 (diff)
downloadmv-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.gz
mv-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.bz2
mv-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.tar.xz
mv-5ce3ea5e8377a1f9898dc08b6cc7f3a9679f4232.zip
Restore mercenary stats if it was respawned.
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r--src/being/playerinfo.cpp9
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;