From 534921cf6e8c2ca683ca7c940306c373cfb0ad2b Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 28 Oct 2014 00:52:43 +0100 Subject: Removed some temporary case-check error messages. - Control flow statements (break, case, continue, default, do, for, if, switch, whilei, else) and sub-function declarations (function) will no longer show a custom error message when they are incorrectly capitalized. - Note: This does not mean that they are no longer case-sensitive. This only means that no special message will be shown in case such an error is detected. The script engine will throw a normal error, as it would with any other kind of typo, rather than treating this as a special case. Enough time was given to update third party scripts, and it is now time to clean up our parsing code and get rid of these special warnings. - Variables, labels and commands will still show a warning for the time being, since the side-effects of silently ignoring it could be quite dangerous. An alternative approach to the case-check will be presented in future. For now, those who want to disable it (and save a bit on execution time and memory use), can simply comment out the #define ENABLE_CASE_CHECK line in script.h, as usual. Signed-off-by: Haru --- src/map/script.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/map/script.h') diff --git a/src/map/script.h b/src/map/script.h index 202326ede..1a46ba02b 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -26,8 +26,7 @@ struct eri; // TODO: Remove temporary code #define ENABLE_CASE_CHECK #define get_script_source(source) ((source) ? (source) : "Unknown (Possibly source or variables stored in database") -#define DeprecationCaseWarning2(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), get_script_source(where)) -#define disp_deprecation_message(func, good, p) disp_warning_message(func": use of deprecated keyword (use '"good"' instead).", (p)) +#define DeprecationCaseWarning(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), get_script_source(where)) #define DeprecationWarning(p) disp_warning_message("This command is deprecated and it will be removed in a future update. Please see the script documentation for an alternative.\n", (p)) -- cgit v1.2.3-60-g2f50