summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 37dd99229..1aeff2e2e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -6038,7 +6038,7 @@ BUILDIN_FUNC(getitem)
else if( (flag=pc_additem(sd,&it,amount)) ){
clif_additem(sd,0,0,flag);
if( pc_candrop(sd,&it) )
- map_addflooritem(&it,amount,sd->bl.m,sd->bl.x,sd->bl.y,NULL,NULL,NULL,0);
+ map_addflooritem(&it,amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
//Logs items, got from (N)PC scripts [Lupus]
@@ -6122,7 +6122,7 @@ BUILDIN_FUNC(getitem2)
item_tmp.card[3]=c4;
if((flag = pc_additem(sd,&item_tmp,amount))) {
clif_additem(sd,0,0,flag);
- map_addflooritem(&item_tmp,amount,sd->bl.m,sd->bl.x,sd->bl.y,NULL,NULL,NULL,0);
+ map_addflooritem(&item_tmp,amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
//Logs items, got from (N)PC scripts [Lupus]
@@ -6269,7 +6269,7 @@ BUILDIN_FUNC(makeitem)
else
item_tmp.identify=itemdb_isidentified(nameid);
- map_addflooritem(&item_tmp,amount,m,x,y,NULL,NULL,NULL,0);
+ map_addflooritem(&item_tmp,amount,m,x,y,0,0,0,0);
}
return 0;
@@ -9806,7 +9806,7 @@ BUILDIN_FUNC(successremovecards)
if((flag=pc_additem(sd,&item_tmp,1))){ // 持てないならドロップ
clif_additem(sd,0,0,flag);
- map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,NULL,NULL,NULL,0);
+ map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
}while(c--);
@@ -9831,7 +9831,7 @@ BUILDIN_FUNC(successremovecards)
if((flag=pc_additem(sd,&item_tmp,1))){ // もてないならドロップ
clif_additem(sd,0,0,flag);
- map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,NULL,NULL,NULL,0);
+ map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
clif_misceffect(&sd->bl,3);
return 0;
@@ -9883,7 +9883,7 @@ BUILDIN_FUNC(failedremovecards)
if((flag=pc_additem(sd,&item_tmp,1))){
clif_additem(sd,0,0,flag);
- map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,NULL,NULL,NULL,0);
+ map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
}
@@ -9920,7 +9920,7 @@ BUILDIN_FUNC(failedremovecards)
if((flag=pc_additem(sd,&item_tmp,1))){
clif_additem(sd,0,0,flag);
- map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,NULL,NULL,NULL,0);
+ map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
clif_misceffect(&sd->bl,2);
@@ -12219,13 +12219,19 @@ BUILDIN_FUNC(query_sql)
//Allows escaping of a given string.
BUILDIN_FUNC(escape_sql)
{
- const char *query;
- char *t_query;
- query = script_getstr(st,2);
-
- t_query = aMallocA((strlen(query)*2+1)*sizeof(char));
- jstrescapecpy(t_query,query);
- script_pushstr(st,t_query);
+ const char *str;
+ char *esc_str;
+ size_t len;
+
+ str = script_getstr(st,2);
+ len = strlen(str);
+ esc_str = aMallocA(len*2+1);
+#if defined(TXT_ONLY)
+ jstrescapecpy(esc_str, str);
+#else
+ Sql_EscapeStringLen(mmysql_handle, esc_str, str, len);
+#endif
+ script_pushstr(st, esc_str);
return 0;
}