summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-26 16:42:39 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-26 16:42:39 +0000
commit2091c7772e8adcb05329e5cf816bba4e0c418daf (patch)
treefecb45fc6c21946e9428bd4e9ada846edbe6a4d4 /src/map/pc.c
parenta25b1a1f0fb28d4262cdbf22bcc7727b576a876a (diff)
downloadhercules-2091c7772e8adcb05329e5cf816bba4e0c418daf.tar.gz
hercules-2091c7772e8adcb05329e5cf816bba4e0c418daf.tar.bz2
hercules-2091c7772e8adcb05329e5cf816bba4e0c418daf.tar.xz
hercules-2091c7772e8adcb05329e5cf816bba4e0c418daf.zip
* Cleaned up script command checkweight.
- Replaced some code parts with calls to pc_checkadditem and pc_inventoryblank (follow up to r13735). - Fixed item id not getting checked for validity properly. * Moved MAX_AMOUNT check in pc_checkadditem to the top of the function, to prevent unnecessary inventory scan before it. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14629 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 45330f343..bb703a208 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3203,6 +3203,9 @@ int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
nullpo_ret(sd);
+ if(amount > MAX_AMOUNT)
+ return ADDITEM_OVERAMOUNT;
+
if(!itemdb_isstackable(nameid))
return ADDITEM_NEW;
@@ -3214,8 +3217,6 @@ int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
}
}
- if(amount > MAX_AMOUNT)
- return ADDITEM_OVERAMOUNT;
return ADDITEM_NEW;
}