summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-rw-r--r--src/being/playerinfo.cpp9
-rw-r--r--src/being/playerinfo.h2
2 files changed, 11 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;
diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h
index c01fdd237..4fcc5dfc1 100644
--- a/src/being/playerinfo.h
+++ b/src/being/playerinfo.h
@@ -58,6 +58,7 @@ struct PlayerInfoBackend final
IntMap mSkills;
};
+class Being;
class FloorItem;
class Inventory;
class Item;
@@ -240,6 +241,7 @@ namespace PlayerInfo
void setMercenary(MercenaryInfo *const info);
+ void setMercenaryBeing(Being *const being);
} // namespace PlayerInfo
#endif // BEING_PLAYERINFO_H