summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 45aa67bac..eef9b1d40 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -89,6 +89,7 @@
#include "resources/db/emotedb.h"
#include "resources/db/homunculusdb.h"
#include "resources/db/horsedb.h"
+#include "resources/db/languagedb.h"
#include "resources/db/mercenarydb.h"
#include "resources/db/monsterdb.h"
#include "resources/db/npcdb.h"
@@ -248,6 +249,7 @@ Being::Being(const BeingId id,
mManner(0),
mAreaSize(11),
mCastEndTime(0),
+ mLanguageId(-1),
mCreatorId(BeingId_zero),
mTeamId(0U),
mLook(0U),
@@ -5326,3 +5328,20 @@ void Being::fixDirectionOffsets(int &offsetX,
offsetX = tmp;
}
}
+
+void Being::setLanguageId(const int lang) restrict2 noexcept2
+{
+ if (lang != mLanguageId)
+ {
+ delete2(mBadges[BadgeIndex::Lang]);
+ const std::string badge = LanguageDb::getIcon(lang);
+ if (!badge.empty())
+ {
+ mBadges[BadgeIndex::Lang] = AnimatedSprite::load(pathJoin(
+ paths.getStringValue("languageIcons"),
+ badge));
+ }
+
+ mLanguageId = lang;
+ }
+}