summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-08-26 20:53:05 +0200
committerGitHub <noreply@github.com>2018-08-26 20:53:05 +0200
commita7bee2cdb8b4d4a2a250d611be4babd27043b6db (patch)
tree0135aa01a07e4ca72ae035c3179da7c82a92b777 /src/plugins
parenta1e841ccf13c63fefad02a1bfce0e50b92c649a0 (diff)
parent4118b1135eb79c211aafb6408a4ad8cf9ce09b02 (diff)
downloadhercules-a7bee2cdb8b4d4a2a250d611be4babd27043b6db.tar.gz
hercules-a7bee2cdb8b4d4a2a250d611be4babd27043b6db.tar.bz2
hercules-a7bee2cdb8b4d4a2a250d611be4babd27043b6db.tar.xz
hercules-a7bee2cdb8b4d4a2a250d611be4babd27043b6db.zip
Merge pull request #2164 from mekolat/addvariable
always set the type to C_NAME when adding variables through script->add_str
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc27
4 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 94ca75f6e..cc093975f 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -6620,6 +6620,8 @@ typedef bool (*HPMHOOK_pre_script_config_read) (const char **filename, bool *imp
typedef bool (*HPMHOOK_post_script_config_read) (bool retVal___, const char *filename, bool imported);
typedef int (*HPMHOOK_pre_script_add_str) (const char **p);
typedef int (*HPMHOOK_post_script_add_str) (int retVal___, const char *p);
+typedef int (*HPMHOOK_pre_script_add_variable) (const char **varname);
+typedef int (*HPMHOOK_post_script_add_variable) (int retVal___, const char *varname);
typedef const char* (*HPMHOOK_pre_script_get_str) (int *id);
typedef const char* (*HPMHOOK_post_script_get_str) (const char* retVal___, int id);
typedef int (*HPMHOOK_pre_script_search_str) (const char **p);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 3b598cd0d..457bf90fe 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -5142,6 +5142,8 @@ struct {
struct HPMHookPoint *HP_script_config_read_post;
struct HPMHookPoint *HP_script_add_str_pre;
struct HPMHookPoint *HP_script_add_str_post;
+ struct HPMHookPoint *HP_script_add_variable_pre;
+ struct HPMHookPoint *HP_script_add_variable_post;
struct HPMHookPoint *HP_script_get_str_pre;
struct HPMHookPoint *HP_script_get_str_post;
struct HPMHookPoint *HP_script_search_str_pre;
@@ -11705,6 +11707,8 @@ struct {
int HP_script_config_read_post;
int HP_script_add_str_pre;
int HP_script_add_str_post;
+ int HP_script_add_variable_pre;
+ int HP_script_add_variable_post;
int HP_script_get_str_pre;
int HP_script_get_str_post;
int HP_script_search_str_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 70ea54928..41e6f9208 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2634,6 +2634,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->setarray_pc, HP_script_setarray_pc) },
{ HP_POP(script->config_read, HP_script_config_read) },
{ HP_POP(script->add_str, HP_script_add_str) },
+ { HP_POP(script->add_variable, HP_script_add_variable) },
{ HP_POP(script->get_str, HP_script_get_str) },
{ HP_POP(script->search_str, HP_script_search_str) },
{ HP_POP(script->setd_sub, HP_script_setd_sub) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 4231eedb7..8ad18f843 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -68495,6 +68495,33 @@ int HP_script_add_str(const char *p) {
}
return retVal___;
}
+int HP_script_add_variable(const char *varname) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_script_add_variable_pre > 0) {
+ int (*preHookFunc) (const char **varname);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_variable_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_add_variable_pre[hIndex].func;
+ retVal___ = preHookFunc(&varname);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.add_variable(varname);
+ }
+ if (HPMHooks.count.HP_script_add_variable_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *varname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_variable_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_add_variable_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, varname);
+ }
+ }
+ return retVal___;
+}
const char* HP_script_get_str(int id) {
int hIndex = 0;
const char* retVal___ = NULL;