- Oops, realized the vsd cid check is before the null pointer check. I AM getting rusty <_<

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14237 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2010-01-30 10:39:02 +00:00
parent f27431c872
commit cc6b9e2cff

View File

@ -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); struct map_session_data* vsd = map_id2sd(aid);
nullpo_retv(sd); nullpo_retv(sd);
if( vsd == NULL || vsd->vender_id == 0 || vsd->vender_id == sd->bl.id )
return; // invalid shop
#if PACKETVER >= 20100105 #if PACKETVER >= 20100105
if( vsd->status.char_id != cid ) if( vsd->status.char_id != cid )
return; //Char-ID check return; //Char-ID check
#endif #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) ) if( sd->bl.m != vsd->bl.m || !check_distance_bl(&sd->bl, &vsd->bl, AREA_SIZE) )
return; // shop too far away return; // shop too far away
if( count < 1 || count > MAX_VENDING || count > vsd->vend_num ) if( count < 1 || count > MAX_VENDING || count > vsd->vend_num )