summaryrefslogtreecommitdiff
path: root/src/map/script.c
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.c
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.c')
-rw-r--r--src/map/script.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c
index aa3713427..4fb4e7224 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2275,7 +2275,10 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
for(i=0; i<size; i++)
linkdb_final(&script->syntax.curly[i].case_label);
#ifdef ENABLE_CASE_CHECK
- script->local_casecheck.clear();
+ script->local_casecheck.clear();
+ script->parser_current_src = NULL;
+ script->parser_current_file = NULL;
+ script->parser_current_line = 0;
#endif // ENABLE_CASE_CHECK
return NULL;
}
@@ -2292,7 +2295,10 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
script->size = 0;
script->buf = NULL;
#ifdef ENABLE_CASE_CHECK
- script->local_casecheck.clear();
+ script->local_casecheck.clear();
+ script->parser_current_src = NULL;
+ script->parser_current_file = NULL;
+ script->parser_current_line = 0;
#endif // ENABLE_CASE_CHECK
return NULL;
}
@@ -2310,7 +2316,10 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
script->size = 0;
script->buf = NULL;
#ifdef ENABLE_CASE_CHECK
- script->local_casecheck.clear();
+ script->local_casecheck.clear();
+ script->parser_current_src = NULL;
+ script->parser_current_file = NULL;
+ script->parser_current_line = 0;
#endif // ENABLE_CASE_CHECK
return NULL;
}
@@ -2428,6 +2437,9 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
code->script_vars = NULL;
#ifdef ENABLE_CASE_CHECK
script->local_casecheck.clear();
+ script->parser_current_src = NULL;
+ script->parser_current_file = NULL;
+ script->parser_current_line = 0;
#endif // ENABLE_CASE_CHECK
return code;
}