From 9fbcc381af5230ab4e9dd92ea25bb6826480e544 Mon Sep 17 00:00:00 2001 From: skotlex Date: Sat, 30 Jan 2010 10:39:02 +0000 Subject: - 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 --- src/map/vending.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/map/vending.c') 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 ) -- cgit v1.2.3-60-g2f50