summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/mob_db2.conf1
-rw-r--r--db/pre-re/mob_db.conf1
-rw-r--r--db/re/mob_db.conf1
-rw-r--r--src/map/mob.c8
4 files changed, 11 insertions, 0 deletions
diff --git a/db/mob_db2.conf b/db/mob_db2.conf
index dd9e65202..e1084cff2 100644
--- a/db/mob_db2.conf
+++ b/db/mob_db2.conf
@@ -37,6 +37,7 @@ mob_db: (
SpriteName: "SPRITE_NAME" (string)
Name: "Mob name" (string)
// ================ Optional fields ===============================
+ JName: "Mob name" (string)
Lv: level (int, defaults to 1)
Hp: health (int, defaults to 1)
Sp: mana (int, defaults to 0)
diff --git a/db/pre-re/mob_db.conf b/db/pre-re/mob_db.conf
index 41787d2b1..33dabad68 100644
--- a/db/pre-re/mob_db.conf
+++ b/db/pre-re/mob_db.conf
@@ -37,6 +37,7 @@ mob_db: (
SpriteName: "SPRITE_NAME" (string)
Name: "Mob name" (string)
// ================ Optional fields ===============================
+ JName: "Mob name" (string)
Lv: level (int, defaults to 1)
Hp: health (int, defaults to 1)
Sp: mana (int, defaults to 0)
diff --git a/db/re/mob_db.conf b/db/re/mob_db.conf
index 6b9ec165d..f6df598cf 100644
--- a/db/re/mob_db.conf
+++ b/db/re/mob_db.conf
@@ -37,6 +37,7 @@ mob_db: (
SpriteName: "SPRITE_NAME" (string)
Name: "Mob name" (string)
// ================ Optional fields ===============================
+ JName: "Mob name" (string)
Lv: level (int, defaults to 1)
Hp: health (int, defaults to 1)
Sp: mana (int, defaults to 0)
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));
}