summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-20 03:28:55 +0100
committerHaru <haru@dotalux.com>2016-01-29 11:00:31 +0100
commit0426f8c42f9f6d94db8d6a23f248e876b79c7973 (patch)
treea18b3e4aa57ec288cd8c26244b478c4ff64bb98e /src/map/mob.c
parentca40527cfa1aca28f06ad1f240593f1191dc9ed6 (diff)
downloadhercules-0426f8c42f9f6d94db8d6a23f248e876b79c7973.tar.gz
hercules-0426f8c42f9f6d94db8d6a23f248e876b79c7973.tar.bz2
hercules-0426f8c42f9f6d94db8d6a23f248e876b79c7973.tar.xz
hercules-0426f8c42f9f6d94db8d6a23f248e876b79c7973.zip
Re-added support for the JName field in the mob db
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 5da9a7162..bc78c6098 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4060,6 +4060,7 @@ int mob_read_db_sub(config_setting_t *mobt, int n, const char *source)
* Id: ID
* SpriteName: "SPRITE_NAME"
* Name: "Mob name"
+ * JName: "Mob name"
* // Optional fields
* Lv: level
* Hp: health
@@ -4149,6 +4150,13 @@ int mob_read_db_sub(config_setting_t *mobt, int n, const char *source)
}
} else {
safestrncpy(md.name, str, sizeof(md.name));
+ }
+
+ if (!libconfig->setting_lookup_string(mobt, "JName", &str) || !*str ) {
+ if (!inherit) {
+ safestrncpy(md.jname, md.name, sizeof(md.jname));
+ }
+ } else {
safestrncpy(md.jname, str, sizeof(md.jname));
}