summaryrefslogtreecommitdiff
path: root/src/map/script.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-09 20:30:02 +0100
committerHaru <haru@dotalux.com>2013-12-01 13:20:44 +0100
commitc6c2ad187c386d8d27d3336dcbdd5a92555493d2 (patch)
tree2feeb3847e42db2e6d35fa48c9893db933f35723 /src/map/script.h
parent49d2dff6314486758832cad3403e1775c3fd7af3 (diff)
downloadhercules-c6c2ad187c386d8d27d3336dcbdd5a92555493d2.tar.gz
hercules-c6c2ad187c386d8d27d3336dcbdd5a92555493d2.tar.bz2
hercules-c6c2ad187c386d8d27d3336dcbdd5a92555493d2.tar.xz
hercules-c6c2ad187c386d8d27d3336dcbdd5a92555493d2.zip
Changed variables, labels, functions, commands to case sensitive.
- Fixes bugreport:7810, thanks to Wend, kyeme, evilpuncker, jaBote, and various other people I may be forgetting to mention http://hercules.ws/board/tracker/issue-7810-disguise-script-command - Due to the nature of this change, I'm leaving the deprecation messages lingering around for a while more (as errors rather than warnings), to make sure they won't pass unnoticed, in case you haven't yet updated your custom scripts to comply with this. - Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.h')
-rw-r--r--src/map/script.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/map/script.h b/src/map/script.h
index aace388ff..4d2c59d92 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -22,8 +22,8 @@ struct eri;
**/
// TODO: Remove temporary code
#define ENABLE_CASE_CHECK
-#define DeprecationWarning(func, bad, good, file, line) ShowWarning("%s: use of deprecated keyword '%s' (use '%s' instead) in file '%s', line '%d'.\n", (func), (bad), (good), (file), (line));
-#define DeprecationWarning2(func, bad, good, where) ShowWarning("%s: detected possible use of wrong case in a script. Found '%s', probably meant to be '%s' (in '%s'). This will become fatal in a near future.\n", (func), (bad), (good), (where));
+#define DeprecationWarning(func, bad, good, file, line) ShowError("%s: use of deprecated keyword '%s' (use '%s' instead) in file '%s', line '%d'.\n", (func), (bad), (good), (file), (line));
+#define DeprecationWarning2(func, bad, good, where) ShowError("%s: detected possible use of wrong case in a script. Found '%s', probably meant to be '%s' (in '%s').\n", (func), (bad), (good), (where));
#define disp_deprecation_message(func, good, p) disp_warning_message(func": use of deprecated keyword (use '"good"' instead).", (p));
#define NUM_WHISPER_VAR 10
@@ -443,6 +443,19 @@ struct script_syntax_data {
int index; // Number of the syntax used in the script
};
+struct casecheck_data {
+ struct str_data_struct *str_data;
+ int str_data_size; // size of the data
+ int str_num; // next id to be assigned
+ // str_buf holds the strings themselves
+ char *str_buf;
+ int str_size; // size of the buffer
+ int str_pos; // next position to be assigned
+ int str_hash[SCRIPT_HASH_SIZE];
+ bool (*add_str) (const char* p);
+ void (*clear) (void);
+};
+
/**
* Interface
**/
@@ -642,16 +655,9 @@ struct script_interface {
int (*run_func) (struct script_state *st);
const char *(*getfuncname) (struct script_state *st);
// for ENABLE_CASE_CHECK
- struct str_data_struct *local_casecheck_str_data;
- int local_casecheck_str_data_size; // size of the data
- int local_casecheck_str_num; // next id to be assigned
- // str_buf holds the strings themselves
- char *local_casecheck_str_buf;
- int local_casecheck_str_size; // size of the buffer
- int local_casecheck_str_pos; // next position to be assigned
- int local_casecheck_str_hash[SCRIPT_HASH_SIZE];
- bool (*local_casecheck_add_str) (const char* p, int h);
- void (*local_casecheck_clear) (void);
+ unsigned int (*calc_hash_ci) (const char *p);
+ struct casecheck_data local_casecheck;
+ struct casecheck_data global_casecheck;
// end ENABLE_CASE_CHECK
};