summaryrefslogtreecommitdiff
path: root/src/map/script.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-02-09 15:42:35 +0100
committerHaru <haru@dotalux.com>2014-02-09 15:42:35 +0100
commit7b19f964b88dffcfdc8c12648d5e4ee8a26a9504 (patch)
tree0c8a5bb1dc15d107db3ef2fac8d12822511bcdec /src/map/script.h
parent51805d1f2cedc084fea6cc390ca23a24291edbec (diff)
downloadhercules-7b19f964b88dffcfdc8c12648d5e4ee8a26a9504.tar.gz
hercules-7b19f964b88dffcfdc8c12648d5e4ee8a26a9504.tar.bz2
hercules-7b19f964b88dffcfdc8c12648d5e4ee8a26a9504.tar.xz
hercules-7b19f964b88dffcfdc8c12648d5e4ee8a26a9504.zip
Improved script case check reports to include more accurate source info.
- Fixes bugreport:8013, thanks to Dastgir Pojee http://hercules.ws/board/tracker/issue-8013-script-add-str-problem/ Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.h')
-rw-r--r--src/map/script.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/script.h b/src/map/script.h
index 4906d4fa8..99e53d3b2 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -23,9 +23,11 @@ struct eri;
**/
// TODO: Remove temporary code
#define ENABLE_CASE_CHECK
-#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 get_script_source(source) ((source) ? (source) : "Unknown (Possibly source or variables stored in database")
+#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), get_script_source(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), get_script_source(where));
#define disp_deprecation_message(func, good, p) disp_warning_message(func": use of deprecated keyword (use '"good"' instead).", (p));
+#undef get_script_source
#define NUM_WHISPER_VAR 10