summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHercules.ws <Hercules@efficiently.awesome>2013-12-02 13:38:11 +0100
committerHerculesWSAPI <Hercules@efficiently.awesome>2013-12-02 13:38:11 +0100
commit050acc31bb35b4f3d5213de5b0bb16ca48c4670f (patch)
tree9130ca7058ba60b74f447b9b42d3c05f1dc2311c /src
parent6e9c385b8fa2fbca97ca23e35f0b8e5dabd13526 (diff)
downloadhercules-050acc31bb35b4f3d5213de5b0bb16ca48c4670f.tar.gz
hercules-050acc31bb35b4f3d5213de5b0bb16ca48c4670f.tar.bz2
hercules-050acc31bb35b4f3d5213de5b0bb16ca48c4670f.tar.xz
hercules-050acc31bb35b4f3d5213de5b0bb16ca48c4670f.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc12
-rw-r--r--src/plugins/HPMHooking/HPMHooking.HookingPoints.inc3
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Hooks.inc51
3 files changed, 18 insertions, 48 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
index 9914c2f17..7e3d24e7b 100644
--- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
@@ -4211,10 +4211,8 @@ struct {
struct HPMHookPoint *HP_script_run_func_post;
struct HPMHookPoint *HP_script_getfuncname_pre;
struct HPMHookPoint *HP_script_getfuncname_post;
- struct HPMHookPoint *HP_script_local_casecheck_add_str_pre;
- struct HPMHookPoint *HP_script_local_casecheck_add_str_post;
- struct HPMHookPoint *HP_script_local_casecheck_clear_pre;
- struct HPMHookPoint *HP_script_local_casecheck_clear_post;
+ struct HPMHookPoint *HP_script_calc_hash_ci_pre;
+ struct HPMHookPoint *HP_script_calc_hash_ci_post;
struct HPMHookPoint *HP_searchstore_open_pre;
struct HPMHookPoint *HP_searchstore_open_post;
struct HPMHookPoint *HP_searchstore_query_pre;
@@ -9180,10 +9178,8 @@ struct {
int HP_script_run_func_post;
int HP_script_getfuncname_pre;
int HP_script_getfuncname_post;
- int HP_script_local_casecheck_add_str_pre;
- int HP_script_local_casecheck_add_str_post;
- int HP_script_local_casecheck_clear_pre;
- int HP_script_local_casecheck_clear_post;
+ int HP_script_calc_hash_ci_pre;
+ int HP_script_calc_hash_ci_post;
int HP_searchstore_open_pre;
int HP_searchstore_open_post;
int HP_searchstore_query_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
index 1d0ef8654..76d8d53e4 100644
--- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
@@ -2139,8 +2139,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->cleanfloor_sub, HP_script_cleanfloor_sub) },
{ HP_POP(script->run_func, HP_script_run_func) },
{ HP_POP(script->getfuncname, HP_script_getfuncname) },
- { HP_POP(script->local_casecheck_add_str, HP_script_local_casecheck_add_str) },
- { HP_POP(script->local_casecheck_clear, HP_script_local_casecheck_clear) },
+ { HP_POP(script->calc_hash_ci, HP_script_calc_hash_ci) },
/* searchstore */
{ HP_POP(searchstore->open, HP_searchstore_open) },
{ HP_POP(searchstore->query, HP_searchstore_query) },
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;