summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-24 13:13:27 -0300
committershennetsind <ind@henn.et>2013-06-24 13:13:27 -0300
commit4ff67a9c9977e216c5b63bf5c80480dba1e2fcab (patch)
tree8e59ec1c7f180bce2f1ec32be0c5de55a77f5e8f /src/map/party.c
parent15cf156a3229532ffb2db0f78b29da228e0b2cc7 (diff)
downloadhercules-4ff67a9c9977e216c5b63bf5c80480dba1e2fcab.tar.gz
hercules-4ff67a9c9977e216c5b63bf5c80480dba1e2fcab.tar.bz2
hercules-4ff67a9c9977e216c5b63bf5c80480dba1e2fcab.tar.xz
hercules-4ff67a9c9977e216c5b63bf5c80480dba1e2fcab.zip
Fixed Bug #7412
Special Thanks to shenhuyong http://hercules.ws/board/tracker/issue-7412-create-instancereloadscript-causes-map-server-crash/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/map/party.c b/src/map/party.c
index adcb35c5a..306c68e3e 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -319,10 +319,12 @@ int party_recv_info(struct party* sp, int char_id)
clif->party_option(p,sd,0x100);
clif->party_info(p,NULL);
for( j = 0; j < p->instances; j++ ) {
- if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
- continue;
- clif->instance_join(sd->fd, p->instance[j]);
- break;
+ if( p->instance[j] >= 0 ) {
+ if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
+ continue;
+ clif->instance_join(sd->fd, p->instance[j]);
+ break;
+ }
}
}
if( char_id != 0 )// requester
@@ -441,10 +443,12 @@ void party_member_joined(struct map_session_data *sd)
int j;
p->data[i].sd = sd;
for( j = 0; j < p->instances; j++ ) {
- if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
- continue;
- clif->instance_join(sd->fd, p->instance[j]);
- break;
+ if( p->instance[j] >= 0 ) {
+ if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
+ continue;
+ clif->instance_join(sd->fd, p->instance[j]);
+ break;
+ }
}
} else
sd->status.party_id = 0; //He does not belongs to the party really?
@@ -502,10 +506,12 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
clif->charnameupdate(sd); //Update char name's display [Skotlex]
for( j = 0; j < p->instances; j++ ) {
- if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
- continue;
- clif->instance_join(sd->fd, p->instance[j]);
- break;
+ if( p->instance[j] >= 0 ) {
+ if( instances[p->instance[j]].idle_timer == INVALID_TIMER && instances[p->instance[j]].progress_timer == INVALID_TIMER )
+ continue;
+ clif->instance_join(sd->fd, p->instance[j]);
+ break;
+ }
}
return 0;
@@ -594,8 +600,10 @@ int party_broken(int party_id)
return 0;
for( j = 0; j < p->instances; j++ ) {
- instance->destroy( p->instance[j] );
- instances[p->instance[j]].owner_id = 0;
+ if( p->instance[j] >= 0 ) {
+ instance->destroy( p->instance[j] );
+ instances[p->instance[j]].owner_id = 0;
+ }
}
for( i = 0; i < MAX_PARTY; i++ ) {