|
@@ -559,8 +559,7 @@ unsigned char* parse_simpleexpr(unsigned char *p)
|
|
int c,l;
|
|
int c,l;
|
|
char *p2;
|
|
char *p2;
|
|
// label , register , function etc
|
|
// label , register , function etc
|
|
- //From what I read, jA figured a better way to handle empty parenthesis '()'
|
|
|
|
- if(skip_word(p)==p/* && !(*p==')' && p[-1]=='(')*/){
|
|
|
|
|
|
+ if(skip_word(p)==p){
|
|
disp_error_message("unexpected character",p);
|
|
disp_error_message("unexpected character",p);
|
|
exit(1);
|
|
exit(1);
|
|
}
|
|
}
|
|
@@ -1494,7 +1493,6 @@ static void read_constdb(void)
|
|
type=0;
|
|
type=0;
|
|
if(sscanf(line,"%[A-Za-z0-9_],%[0-9xXA-Fa-f],%d",name,val,&type)>=2 ||
|
|
if(sscanf(line,"%[A-Za-z0-9_],%[0-9xXA-Fa-f],%d",name,val,&type)>=2 ||
|
|
sscanf(line,"%[A-Za-z0-9_] %[0-9xXA-Fa-f] %d",name,val,&type)>=2){
|
|
sscanf(line,"%[A-Za-z0-9_] %[0-9xXA-Fa-f] %d",name,val,&type)>=2){
|
|
-
|
|
|
|
for(i=0;name[i];i++)
|
|
for(i=0;name[i];i++)
|
|
name[i]=tolower(name[i]);
|
|
name[i]=tolower(name[i]);
|
|
n=add_str((const unsigned char *) name);
|
|
n=add_str((const unsigned char *) name);
|
|
@@ -1929,12 +1927,13 @@ char* conv_str(struct script_state *st,struct script_data *data)
|
|
snprintf(buf,ITEM_NAME_LENGTH, "%d",data->u.num);
|
|
snprintf(buf,ITEM_NAME_LENGTH, "%d",data->u.num);
|
|
data->type=C_STR;
|
|
data->type=C_STR;
|
|
data->u.str=buf;
|
|
data->u.str=buf;
|
|
-#if 1
|
|
|
|
|
|
+ } else if(data->type==C_POS) {
|
|
|
|
+ // Protect form crashes by passing labels to string-expected args [jA2200]
|
|
|
|
+ data->type = C_CONSTSTR;
|
|
|
|
+ data->u.str = "** SCRIPT ERROR **";
|
|
} else if(data->type==C_NAME){
|
|
} else if(data->type==C_NAME){
|
|
- // テンポラリ。本来無いはず
|
|
|
|
data->type=C_CONSTSTR;
|
|
data->type=C_CONSTSTR;
|
|
data->u.str=str_buf+str_data[data->u.num].str;
|
|
data->u.str=str_buf+str_data[data->u.num].str;
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
return data->u.str;
|
|
return data->u.str;
|
|
}
|
|
}
|
|
@@ -2630,10 +2629,10 @@ void run_script_main(struct script_state *st)
|
|
if(stack->sp > stack->defsp)
|
|
if(stack->sp > stack->defsp)
|
|
{ //sp > defsp is valid in cases when you invoke functions and don't use the returned value. [Skotlex]
|
|
{ //sp > defsp is valid in cases when you invoke functions and don't use the returned value. [Skotlex]
|
|
//Since sp is supposed to be defsp in these cases, we could assume the extra stack elements are unneeded.
|
|
//Since sp is supposed to be defsp in these cases, we could assume the extra stack elements are unneeded.
|
|
- if (battle_config.etc_log)
|
|
|
|
- {
|
|
|
|
- ShowWarning("Clearing unused stack stack.sp(%d) -> default(%d)\n",stack->sp,stack->defsp);
|
|
|
|
- report_src(st);
|
|
|
|
|
|
+ if (battle_config.etc_log)
|
|
|
|
+ {
|
|
|
|
+ ShowWarning("Clearing unused stack stack.sp(%d) -> default(%d)\n",stack->sp,stack->defsp);
|
|
|
|
+ report_src(st);
|
|
}
|
|
}
|
|
pop_stack(stack, stack->defsp, stack->sp); //Clear out the unused stack-section.
|
|
pop_stack(stack, stack->defsp, stack->sp); //Clear out the unused stack-section.
|
|
} else if(battle_config.error_log)
|
|
} else if(battle_config.error_log)
|
|
@@ -2791,7 +2790,6 @@ int mapreg_setreg(int num,int val)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
- // else
|
|
|
|
} else { // [zBuffer]
|
|
} else { // [zBuffer]
|
|
#if !defined(TXT_ONLY) && defined(MAPREGSQL)
|
|
#if !defined(TXT_ONLY) && defined(MAPREGSQL)
|
|
if(name[1] != '@') { // Remove from database because it is unused.
|
|
if(name[1] != '@') { // Remove from database because it is unused.
|
|
@@ -11715,7 +11713,6 @@ int buildin_axtoi(struct script_state *st)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// [zBuffer] List of player cont commands --->
|
|
// [zBuffer] List of player cont commands --->
|
|
int buildin_rid2name(struct script_state *st){
|
|
int buildin_rid2name(struct script_state *st){
|
|
struct block_list *bl = NULL;
|
|
struct block_list *bl = NULL;
|