summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-25 06:54:53 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-25 06:54:53 +0000
commitb775271bebd5b251e0abbaa97d030e2aeea354a9 (patch)
tree418bc3fd782cc5351855e031aa025e34db842126 /src
parentbf30482687e90e6e859ca263dc20474bad4d7daf (diff)
downloadhercules-b775271bebd5b251e0abbaa97d030e2aeea354a9.tar.gz
hercules-b775271bebd5b251e0abbaa97d030e2aeea354a9.tar.bz2
hercules-b775271bebd5b251e0abbaa97d030e2aeea354a9.tar.xz
hercules-b775271bebd5b251e0abbaa97d030e2aeea354a9.zip
* Modified delitem/delitem2 to have the same behaviour as getitem/getitem2 (optional account_id parameter) bugreport:1035
* Modified doc in consequence git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12648 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 6c2f30c55..316bf113a 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5366,18 +5366,16 @@ BUILDIN_FUNC(getitem)
it.identify=1;
else
it.identify=itemdb_isidentified(nameid);
+
if( script_hasdata(st,4) )
- {// <character ID>
- sd=map_id2sd(script_getnum(st,4));
- } else
- {// attached player
- sd=script_rid2sd(st);
- }
+ sd=map_id2sd(script_getnum(st,4)); // <Account ID>
+ else
+ sd=script_rid2sd(st); // Attached player
+
if( sd == NULL ) // no target
return 0;
-
- //Check if it's stackable.
+ //Check if it's stackable.
if (!itemdb_isstackable(nameid))
get_count = 1;
else
@@ -5416,8 +5414,12 @@ BUILDIN_FUNC(getitem2)
TBL_PC *sd;
struct script_data *data;
- sd = script_rid2sd(st);
- if( sd == NULL )
+ if( script_hasdata(st,11) )
+ sd=map_id2sd(script_getnum(st,11)); // <Account ID>
+ else
+ sd=script_rid2sd(st); // Attached player
+
+ if( sd == NULL ) // no target
return 0;
data=script_getdata(st,2);
@@ -5440,10 +5442,6 @@ BUILDIN_FUNC(getitem2)
c2=script_getnum(st,8);
c3=script_getnum(st,9);
c4=script_getnum(st,10);
- if( script_hasdata(st,11) ) //アイテムを指定したIDに渡す
- sd=map_id2sd(script_getnum(st,11));
- if(sd == NULL) //アイテムを渡す相手がいなかったらお帰り
- return 0;
if(nameid<0) { // ランダム
nameid=itemdb_searchrandomid(-nameid);
@@ -5657,8 +5655,12 @@ BUILDIN_FUNC(delitem)
TBL_PC *sd;
struct script_data *data;
- sd = script_rid2sd(st);
- if( sd == NULL )
+ if( script_hasdata(st,4) )
+ sd=map_id2sd(script_getnum(st,4)); // <Account ID>
+ else
+ sd=script_rid2sd(st); // Attached player
+
+ if( sd == NULL ) // no target
return 0;
data=script_getdata(st,2);
@@ -5763,8 +5765,12 @@ BUILDIN_FUNC(delitem2)
TBL_PC *sd;
struct script_data *data;
- sd = script_rid2sd(st);
- if( sd == NULL )
+ if( script_hasdata(st,11) )
+ sd=map_id2sd(script_getnum(st,11)); // <Account ID>
+ else
+ sd=script_rid2sd(st); // Attached player
+
+ if( sd == NULL ) // no target
return 0;
data=script_getdata(st,2);