summaryrefslogtreecommitdiff
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
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>
-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));
}