summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-01-30 10:39:02 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-01-30 10:39:02 +0000
commit9fbcc381af5230ab4e9dd92ea25bb6826480e544 (patch)
tree9543f002443188ee2433d6b6e7c09f8d988b50ea
parentb0c3d82998b5b124127e32cb288f10bb377d13e7 (diff)
downloadhercules-9fbcc381af5230ab4e9dd92ea25bb6826480e544.tar.gz
hercules-9fbcc381af5230ab4e9dd92ea25bb6826480e544.tar.bz2
hercules-9fbcc381af5230ab4e9dd92ea25bb6826480e544.tar.xz
hercules-9fbcc381af5230ab4e9dd92ea25bb6826480e544.zip
- Oops, realized the vsd cid check is before the null pointer check. I AM getting rusty <_<
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14237 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/vending.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/map/vending.c b/src/map/vending.c
index 9cc691f70..67e5ebf19 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -64,13 +64,12 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int cid, const ui
struct map_session_data* vsd = map_id2sd(aid);
nullpo_retv(sd);
+ if( vsd == NULL || vsd->vender_id == 0 || vsd->vender_id == sd->bl.id )
+ return; // invalid shop
#if PACKETVER >= 20100105
if( vsd->status.char_id != cid )
return; //Char-ID check
#endif
-
- if( vsd == NULL || vsd->vender_id == 0 || vsd->vender_id == sd->bl.id )
- return; // invalid shop
if( sd->bl.m != vsd->bl.m || !check_distance_bl(&sd->bl, &vsd->bl, AREA_SIZE) )
return; // shop too far away
if( count < 1 || count > MAX_VENDING || count > vsd->vend_num )