diff options
author | Haru <haru@dotalux.com> | 2016-09-10 01:04:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-10 01:04:18 +0200 |
commit | 3d4e646d56afbde1e5ca58b7b791df876360092c (patch) | |
tree | da45b4fbeed6a992f135f8e19cc5d1d8638458ed /src/map/skill.c | |
parent | a45a8d92d11acf1f3f2d10853bf60ebb515b84a5 (diff) | |
parent | ce55087fe7389c785515617c0b4c8628adeace53 (diff) | |
download | hercules-3d4e646d56afbde1e5ca58b7b791df876360092c.tar.gz hercules-3d4e646d56afbde1e5ca58b7b791df876360092c.tar.bz2 hercules-3d4e646d56afbde1e5ca58b7b791df876360092c.tar.xz hercules-3d4e646d56afbde1e5ca58b7b791df876360092c.zip |
Merge pull request #1416 from 4144/hpmfix
Add some fixes for HPM
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 40001659c..561154bdf 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -19417,7 +19417,7 @@ void skill_validate_castnodex(struct config_setting_t *conf, struct s_skill_db * * @param *sk struct, pointer to s_skill_db * @return void */ -int skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db *sk ) +int skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db *sk) { if (strcmpi(type, "NoWeapon") == 0) { if (on) { @@ -19628,11 +19628,11 @@ void skill_validate_weapontype(struct config_setting_t *conf, struct s_skill_db int j = 0; struct config_setting_t *wpt = NULL; while ((wpt = libconfig->setting_get_elem(tt, j++)) != NULL) { - if (skill_validate_weapontype_sub(config_setting_name(wpt), libconfig->setting_get_bool_real(wpt), sk)) + if (skill->validate_weapontype_sub(config_setting_name(wpt), libconfig->setting_get_bool_real(wpt), sk)) skilldb_invalid_error(config_setting_name(wpt), config_setting_name(tt), sk->nameid); } } else if (libconfig->setting_lookup_string(conf, "WeaponTypes", &type)) { - if (skill_validate_weapontype_sub(type, true, sk)) + if (skill->validate_weapontype_sub(type, true, sk)) skilldb_invalid_error(type, "WeaponTypes", sk->nameid); } } @@ -19730,11 +19730,11 @@ void skill_validate_ammotype(struct config_setting_t *conf, struct s_skill_db *s int j = 0; struct config_setting_t *amt = { 0 }; while ((amt = libconfig->setting_get_elem(tt, j++))) { - if (skill_validate_ammotype_sub(config_setting_name(amt), libconfig->setting_get_bool_real(amt), sk)) + if (skill->validate_ammotype_sub(config_setting_name(amt), libconfig->setting_get_bool_real(amt), sk)) skilldb_invalid_error(config_setting_name(amt), config_setting_name(tt), sk->nameid); } } else if( libconfig->setting_lookup_string(conf, "AmmoTypes", &tstr)) { - if (skill_validate_ammotype_sub(tstr, true, sk)) + if (skill->validate_ammotype_sub(tstr, true, sk)) skilldb_invalid_error(tstr, "AmmoTypes", sk->nameid); } } @@ -19967,7 +19967,7 @@ void skill_validate_unit_flag(struct config_setting_t *conf, struct s_skill_db * while ((tt = libconfig->setting_get_elem(t, j++))) { const char *name = config_setting_name(tt); - if (skill_validate_unit_flag_sub(name, libconfig->setting_get_bool_real(tt), sk)) + if (skill->validate_unit_flag_sub(name, libconfig->setting_get_bool_real(tt), sk)) skilldb_invalid_error(name, config_setting_name(t), sk->nameid); } } @@ -20605,6 +20605,9 @@ void skill_defaults(void) { skill->validate_unit_flag = skill_validate_unit_flag; skill->validate_additional_fields = skill_validate_additional_fields; skill->validate_skilldb = skill_validate_skilldb; + skill->validate_weapontype_sub = skill_validate_weapontype_sub; + skill->validate_ammotype_sub = skill_validate_ammotype_sub; + skill->validate_unit_flag_sub = skill_validate_unit_flag_sub; skill->read_skilldb = skill_read_skilldb; skill->config_set_level = skill_config_set_level; skill->level_set_value = skill_level_set_value; |