From d0f11e8df04bd9f791e93e616ca816c79c8158ba Mon Sep 17 00:00:00 2001 From: epoque11 Date: Fri, 9 Dec 2011 03:59:34 +0000 Subject: - Optimised party x/y timer processing by excluding parties with no members online git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15045 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/party.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/party.c b/src/map/party.c index f47f8e5c9..a8a524046 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 ) -- cgit v1.2.3-60-g2f50