From 7b19f964b88dffcfdc8c12648d5e4ee8a26a9504 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 9 Feb 2014 15:42:35 +0100 Subject: 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 --- src/map/script.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/map/script.c') 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; isyntax.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; } -- cgit v1.2.3-70-g09d2