From aa2686893c9d82e15db07352aac821b5c1227a30 Mon Sep 17 00:00:00 2001 From: epoque11 Date: Fri, 9 Dec 2011 03:59:34 +0000 Subject: [PATCH] - Optimised party x/y timer processing by excluding parties with no members online git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15045 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/party.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/map/party.c b/src/map/party.c index f47f8e5c95..a8a5240461 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -873,11 +873,16 @@ int party_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data) for( p = (struct party_data*)iter->first(iter,NULL); iter->exists(iter); p = (struct party_data*)iter->next(iter,NULL) ) { int i; + + if( !p->party.count ) + {// no online party members so do not iterate + continue; + } + // for each member of this party, for( i = 0; i < MAX_PARTY; i++ ) { - //struct map_session_data* sd = p->data[i].sd; - struct map_session_data* sd = map_charid2sd(p->party.member[i].char_id); //temporary crashfix + struct map_session_data* sd = p->data[i].sd; if( !sd ) continue; if( p->data[i].x != sd->bl.x || p->data[i].y != sd->bl.y )