summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
authorepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-09 03:59:34 +0000
committerepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-09 03:59:34 +0000
commitd0f11e8df04bd9f791e93e616ca816c79c8158ba (patch)
treecd5d514116b192dbb4b3c646e180430216089f0a /src/map/party.c
parentbf7d71465ddd0cdf88c94fb4ff71dde33474b5a7 (diff)
downloadhercules-d0f11e8df04bd9f791e93e616ca816c79c8158ba.tar.gz
hercules-d0f11e8df04bd9f791e93e616ca816c79c8158ba.tar.bz2
hercules-d0f11e8df04bd9f791e93e616ca816c79c8158ba.tar.xz
hercules-d0f11e8df04bd9f791e93e616ca816c79c8158ba.zip
- 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
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c9
1 files changed, 7 insertions, 2 deletions
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 )