diff options
-rw-r--r-- | src/map/vending.c | 5 |
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 ) |