summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-23 03:14:57 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-09-23 03:14:57 +0000
commit7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37 (patch)
tree32d69f53bacb7597d55e5a27839dde6d952aca77 /src/map/script.c
parenta278eb2e074ce0cb0c9c68e372c66b87f84577a1 (diff)
downloadhercules-7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37.tar.gz
hercules-7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37.tar.bz2
hercules-7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37.tar.xz
hercules-7d10ecf3d159a3d4765b65a1eb1bd11399b0ef37.zip
* map_addflooritem and struct item_drop_list using id's instead of struct map_session_data's (fixes bugreport:36).
* Fixed buildin_escape_sql not properly escaping in sql servers. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11279 54d463be-8e91-2dee-dedb-b68131a5f0ec
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;
}