From 9e2ae37d45a32a5dfcca2fc77ed61703d31dc468 Mon Sep 17 00:00:00 2001 From: Haru Date: Fri, 18 Sep 2015 15:55:39 +0200 Subject: Follow-up to 21442a885b1214e1b6a2f23a2553da416fb97238 Corrected a nullpo check in the clif_party_withdraw function (in some cases, it is acceptable for sd to be NULL -- documentation is still lacking though) Signed-off-by: Haru --- src/map/clif.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index d1b20a750..991c9a0e7 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -6615,19 +6615,18 @@ void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int unsigned char buf[64]; nullpo_retv(p); - nullpo_retv(sd); nullpo_retv(name); - if(!sd && (flag&0xf0)==0) - { + if(!sd && (flag&0xf0)==0) { // TODO: Document this flag int i; - for(i=0;idata[i].sd;i++) - ; - if (i < MAX_PARTY) - sd = p->data[i].sd; + // Search for any online party member + ARR_FIND(0, MAX_PARTY, i, p->data[i].sd != NULL); + if (i != MAX_PARTY) + sd = p->data[i].sd; } - if(!sd) return; + if (!sd) + return; WBUFW(buf,0)=0x105; WBUFL(buf,2)=account_id; -- cgit v1.2.3-60-g2f50