summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
diff options
context:
space:
mode:
authorSmokexyz <sagunkho@hotmail.com>2017-07-05 23:10:59 +0530
committerSmokexyz <sagunkho@hotmail.com>2017-07-05 23:10:59 +0530
commit7569afbe6932e55c6a62f0747ea1e7b5ba3c977e (patch)
tree4f4e77a2267daf8c8cb6a4330fd00f0309ab1309 /src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
parent7a2447204644b53e64a730c9c8428cc5b33f5aa2 (diff)
downloadhercules-7569afbe6932e55c6a62f0747ea1e7b5ba3c977e.tar.gz
hercules-7569afbe6932e55c6a62f0747ea1e7b5ba3c977e.tar.bz2
hercules-7569afbe6932e55c6a62f0747ea1e7b5ba3c977e.tar.xz
hercules-7569afbe6932e55c6a62f0747ea1e7b5ba3c977e.zip
Update HPM Hooking (Follow up 7a2447204644b53e64a730c9c8428cc5b33f5aa2)
Diffstat (limited to 'src/plugins/HPMHooking/HPMHooking_char.Hooks.inc')
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.Hooks.inc39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
index 96e068903..a2a9fa8e2 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
@@ -528,15 +528,42 @@ int HP_chr_mmo_char_tosql(int char_id, struct mmo_charstatus *p) {
}
return retVal___;
}
-int HP_chr_memitemdata_to_sql(const struct item items[], int max, int id, int tableswitch) {
+int HP_chr_getitemdata_from_sql(struct item *items, int max, int guid, enum inventory_table_type table) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_chr_getitemdata_from_sql_pre > 0) {
+ int (*preHookFunc) (struct item **items, int *max, int *guid, enum inventory_table_type *table);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_getitemdata_from_sql_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_getitemdata_from_sql_pre[hIndex].func;
+ retVal___ = preHookFunc(&items, &max, &guid, &table);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.getitemdata_from_sql(items, max, guid, table);
+ }
+ if (HPMHooks.count.HP_chr_getitemdata_from_sql_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item *items, int max, int guid, enum inventory_table_type table);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_getitemdata_from_sql_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_getitemdata_from_sql_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, items, max, guid, table);
+ }
+ }
+ return retVal___;
+}
+int HP_chr_memitemdata_to_sql(const struct item items[], int id, enum inventory_table_type table) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_chr_memitemdata_to_sql_pre > 0) {
- int (*preHookFunc) (const struct item *items[], int *max, int *id, int *tableswitch);
+ int (*preHookFunc) (const struct item *items[], int *id, enum inventory_table_type *table);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_memitemdata_to_sql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_memitemdata_to_sql_pre[hIndex].func;
- retVal___ = preHookFunc(&items, &max, &id, &tableswitch);
+ retVal___ = preHookFunc(&items, &id, &table);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -544,13 +571,13 @@ int HP_chr_memitemdata_to_sql(const struct item items[], int max, int id, int ta
}
}
{
- retVal___ = HPMHooks.source.chr.memitemdata_to_sql(items, max, id, tableswitch);
+ retVal___ = HPMHooks.source.chr.memitemdata_to_sql(items, id, table);
}
if (HPMHooks.count.HP_chr_memitemdata_to_sql_post > 0) {
- int (*postHookFunc) (int retVal___, const struct item items[], int max, int id, int tableswitch);
+ int (*postHookFunc) (int retVal___, const struct item items[], int id, enum inventory_table_type table);
for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_memitemdata_to_sql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_memitemdata_to_sql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, items, max, id, tableswitch);
+ retVal___ = postHookFunc(retVal___, items, id, table);
}
}
return retVal___;