diff options
author | Haru <haru@dotalux.com> | 2020-02-09 23:12:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 23:12:51 +0100 |
commit | 965d3faddd4f7acc85a9afba9db4af6ee8b29224 (patch) | |
tree | 7fad03f6233153df87a77edd25c5e9a7b104050f | |
parent | 1a0619fcedf573c7004489470f169e112fa1bb62 (diff) | |
parent | 4c630a6d239afae8f231977fa41ac460d2288679 (diff) | |
download | hercules-965d3faddd4f7acc85a9afba9db4af6ee8b29224.tar.gz hercules-965d3faddd4f7acc85a9afba9db4af6ee8b29224.tar.bz2 hercules-965d3faddd4f7acc85a9afba9db4af6ee8b29224.tar.xz hercules-965d3faddd4f7acc85a9afba9db4af6ee8b29224.zip |
Merge pull request #2622 from Kenpachi2k13/mob_viewdata_fix
Make mob DB field ViewData->HairStyleId defaulting to 1 instead of 0.
-rw-r--r-- | db/pre-re/mob_db.conf | 2 | ||||
-rw-r--r-- | db/re/mob_db.conf | 2 | ||||
-rw-r--r-- | doc/mob_db.txt | 5 | ||||
-rw-r--r-- | src/map/mob.c | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/db/pre-re/mob_db.conf b/db/pre-re/mob_db.conf index 45592ad90..78e255f36 100644 --- a/db/pre-re/mob_db.conf +++ b/db/pre-re/mob_db.conf @@ -102,7 +102,7 @@ mob_db: ( HeadTopId: top headgear id (int, defaults to 0) HeadMidId: middle headgear id (int, defaults to 0) HeadLowId: lower headgear id (int, defaults to 0) - HairStyleId: hair style id (int, defaults to 0) + HairStyleId: hair style id (int, defaults to 1) BodyStyleId: clothes id (int, defaults to 0) HairColorId: hair color id (int, defaults to 0) BodyColorId: clothes color id (int, defaults to 0) diff --git a/db/re/mob_db.conf b/db/re/mob_db.conf index 4f5c6ad9b..492b75a04 100644 --- a/db/re/mob_db.conf +++ b/db/re/mob_db.conf @@ -102,7 +102,7 @@ mob_db: ( HeadTopId: top headgear id (int, defaults to 0) HeadMidId: middle headgear id (int, defaults to 0) HeadLowId: lower headgear id (int, defaults to 0) - HairStyleId: hair style id (int, defaults to 0) + HairStyleId: hair style id (int, defaults to 1) BodyStyleId: clothes id (int, defaults to 0) HairColorId: hair color id (int, defaults to 0) BodyColorId: clothes color id (int, defaults to 0) diff --git a/doc/mob_db.txt b/doc/mob_db.txt index 53d345255..0280ae9c4 100644 --- a/doc/mob_db.txt +++ b/doc/mob_db.txt @@ -82,7 +82,7 @@ mob_db: ( HeadTopId: top headgear id (int, defaults to 0) HeadMidId: middle headgear id (int, defaults to 0) HeadLowId: lower headgear id (int, defaults to 0) - HairStyleId: hair style id (int, defaults to 0) + HairStyleId: hair style id (int, defaults to 1) BodyStyleId: clothes id (int, defaults to 0) HairColorId: hair color id (int, defaults to 0) BodyColorId: clothes color id (int, defaults to 0) @@ -193,7 +193,7 @@ Element: Monster's element. Sets element type and level. Mode: Monster AI behaviour. If this block is omitted, monster doesn't react to anything. All the settings in this group are boolean values, Default value is false (mode not set) for any missing setting. - See /doc/sample/mob_db_mode_list.txt for more information about monsters Mode types. + See /doc/mob_db_mode_list.md for more information about monsters Mode types. MoveSpeed: Monster's speed. Sets speed (cells/sec). MoveSpeed is calculated to Hercules with this formula: 1000 / SPEED (CELLS/SEC) @@ -278,3 +278,4 @@ DamageTakenRate: ViewData: Overrides the default view data sent to the client with the given values for: Sprite, Weapon, Shield, Robe, HeadTop, HeadMid, HeadLow, HairStyle, BodyStyle, HairColor, BodyColor, Gender, Options + Note: HairStyleId will only default to 1, if the ViewData block is defined. diff --git a/src/map/mob.c b/src/map/mob.c index 3b39542da..0830e5a5a 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -4349,8 +4349,12 @@ static void mob_read_db_viewdata_sub(struct mob_db *entry, struct config_setting entry->vd.head_mid = libconfig->setting_get_int(it); if ((it = libconfig->setting_get_member(t, "HeadLowId")) != NULL) entry->vd.head_bottom = libconfig->setting_get_int(it); + if ((it = libconfig->setting_get_member(t, "HairStyleId")) != NULL) entry->vd.hair_style = libconfig->setting_get_int(it); + else + entry->vd.hair_style = 1; + if ((it = libconfig->setting_get_member(t, "BodyStyleId")) != NULL) entry->vd.body_style = libconfig->setting_get_int(it); if ((it = libconfig->setting_get_member(t, "HairColorId")) != NULL) |