diff options
author | shennetsind <ind@henn.et> | 2013-12-02 13:18:39 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-12-02 13:18:39 -0200 |
commit | 95581cedd9a89d8eac918bdc77c1a98e017abc46 (patch) | |
tree | 2dec92f4a0a9913de607741bd7d7224d8241409c /src/plugins/HPMHooking/HPMHooking.Hooks.inc | |
parent | e46ca28bddd673f8217456297f596e0fe3c67609 (diff) | |
parent | 9f210e13ce08340fc4920311518187e8a03a636f (diff) | |
download | hercules-95581cedd9a89d8eac918bdc77c1a98e017abc46.tar.gz hercules-95581cedd9a89d8eac918bdc77c1a98e017abc46.tar.bz2 hercules-95581cedd9a89d8eac918bdc77c1a98e017abc46.tar.xz hercules-95581cedd9a89d8eac918bdc77c1a98e017abc46.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/plugins/HPMHooking/HPMHooking.Hooks.inc')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 06a1299d5..4c119f6e5 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -54419,14 +54419,14 @@ const char* HP_script_getfuncname(struct script_state *st) { } return retVal___; } -bool HP_script_local_casecheck_add_str(const char *p, int h) { +unsigned int HP_script_calc_hash_ci(const char *p) { int hIndex = 0; - bool retVal___ = false; - if( HPMHooks.count.HP_script_local_casecheck_add_str_pre ) { - bool (*preHookFunc) (const char *p, int *h); - for(hIndex = 0; hIndex < HPMHooks.count.HP_script_local_casecheck_add_str_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_script_local_casecheck_add_str_pre[hIndex].func; - retVal___ = preHookFunc(p, &h); + unsigned int retVal___ = 0; + if( HPMHooks.count.HP_script_calc_hash_ci_pre ) { + unsigned int (*preHookFunc) (const char *p); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_ci_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_calc_hash_ci_pre[hIndex].func; + retVal___ = preHookFunc(p); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -54434,42 +54434,17 @@ bool HP_script_local_casecheck_add_str(const char *p, int h) { } } { - retVal___ = HPMHooks.source.script.local_casecheck_add_str(p, h); + retVal___ = HPMHooks.source.script.calc_hash_ci(p); } - if( HPMHooks.count.HP_script_local_casecheck_add_str_post ) { - bool (*postHookFunc) (bool retVal___, const char *p, int *h); - for(hIndex = 0; hIndex < HPMHooks.count.HP_script_local_casecheck_add_str_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_script_local_casecheck_add_str_post[hIndex].func; - retVal___ = postHookFunc(retVal___, p, &h); + if( HPMHooks.count.HP_script_calc_hash_ci_post ) { + unsigned int (*postHookFunc) (unsigned int retVal___, const char *p); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_ci_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_calc_hash_ci_post[hIndex].func; + retVal___ = postHookFunc(retVal___, p); } } return retVal___; } -void HP_script_local_casecheck_clear(void) { - int hIndex = 0; - if( HPMHooks.count.HP_script_local_casecheck_clear_pre ) { - void (*preHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_script_local_casecheck_clear_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_script_local_casecheck_clear_pre[hIndex].func; - preHookFunc(); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.script.local_casecheck_clear(); - } - if( HPMHooks.count.HP_script_local_casecheck_clear_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_script_local_casecheck_clear_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_script_local_casecheck_clear_post[hIndex].func; - postHookFunc(); - } - } - return; -} /* searchstore */ bool HP_searchstore_open(struct map_session_data *sd, unsigned int uses, unsigned short effect) { int hIndex = 0; |