diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-03 16:47:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-03 16:47:05 +0300 |
commit | a829088c61f04645794bf829a62aa8e3c06a7aa2 (patch) | |
tree | 52f0b1bf9ea4a629db8ad5caa58f79cb9e7d70e9 | |
parent | 2d4789d60861e498e11aca0f22ebb61014c488f1 (diff) | |
download | hercules-a829088c61f04645794bf829a62aa8e3c06a7aa2.tar.gz hercules-a829088c61f04645794bf829a62aa8e3c06a7aa2.tar.bz2 hercules-a829088c61f04645794bf829a62aa8e3c06a7aa2.tar.xz hercules-a829088c61f04645794bf829a62aa8e3c06a7aa2.zip |
Add some missing functions in skill.c into interface.
-rwxr-xr-x | configure | 83 | ||||
-rw-r--r-- | src/map/skill.c | 15 | ||||
-rw-r--r-- | src/map/skill.h | 3 |
3 files changed, 67 insertions, 34 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac 302aefb. +# From configure.ac 2d4789d. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -6066,33 +6066,6 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-omit-frame-pointer" >&5 -$as_echo_n "checking whether $CC supports -fno-omit-frame-pointer... " >&6; } - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-omit-frame-pointer" - OLD_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -fno-omit-frame-pointer" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - LDFLAGS="$OLD_LDFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - fi fi @@ -8242,10 +8215,64 @@ case $enable_debug in "yes") CFLAGS="$CFLAGS -g" CPPFLAGS="$CPPFLAGS -DDEBUG" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-omit-frame-pointer" >&5 +$as_echo_n "checking whether $CC supports -fno-omit-frame-pointer... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-omit-frame-pointer" + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -fno-omit-frame-pointer" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + ;; "gdb") CFLAGS="$CFLAGS -ggdb" CPPFLAGS="$CPPFLAGS -DDEBUG" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-omit-frame-pointer" >&5 +$as_echo_n "checking whether $CC supports -fno-omit-frame-pointer... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-omit-frame-pointer" + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -fno-omit-frame-pointer" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + ;; esac 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; diff --git a/src/map/skill.h b/src/map/skill.h index c37f9ec41..c7761b082 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -2056,6 +2056,9 @@ struct skill_interface { void (*validate_unit_flag) (struct config_setting_t *conf, struct s_skill_db *sk); void (*validate_additional_fields) (struct config_setting_t *conf, struct s_skill_db *sk); bool (*validate_skilldb) (struct s_skill_db *skt, const char *source); + int (*validate_weapontype_sub) (const char *type, bool on, struct s_skill_db *sk); + int (*validate_ammotype_sub) (const char *type, bool on, struct s_skill_db *sk); + int (*validate_unit_flag_sub) (const char *type, bool on, struct s_skill_db *sk); bool (*read_skilldb) (const char *filename); void (*config_set_level) (struct config_setting_t *conf, int *arr); void (*level_set_value) (int *arr, int value); |