summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-06-01 04:01:16 +0200
committerGitHub <noreply@github.com>2020-06-01 04:01:16 +0200
commitb9f7d1439c84b64facaf7d2875adc29110c65cf4 (patch)
tree808162f3083ac05b3221c7ffcdb4e52ffd4fb90a /src/map/party.c
parent6188b2eb25c9fdcd33cfbef50e3dd41774f37994 (diff)
parent410e04c2562f7d7dd9a2f242d6ef821dbe0b2fc5 (diff)
downloadhercules-b9f7d1439c84b64facaf7d2875adc29110c65cf4.tar.gz
hercules-b9f7d1439c84b64facaf7d2875adc29110c65cf4.tar.bz2
hercules-b9f7d1439c84b64facaf7d2875adc29110c65cf4.tar.xz
hercules-b9f7d1439c84b64facaf7d2875adc29110c65cf4.zip
Merge pull request #2713 from 4144/updatepackets
Update packets up to 2020-05-20
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 7d7f69620..8eeae2215 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -677,17 +677,18 @@ static int party_member_withdraw(int party_id, int account_id, int char_id)
/// Invoked (from char-server) when a party is disbanded.
static int party_broken(int party_id)
{
- struct party_data* p;
- int i, j;
+ int i;
- p = party->search(party_id);
- if( p == NULL )
+ struct party_data *p = party->search(party_id);
+ if (p == NULL)
return 0;
- for( j = 0; j < p->instances; j++ ) {
- if( p->instance[j] >= 0 ) {
- instance->destroy( p->instance[j] );
- instance->list[p->instance[j]].owner_id = 0;
+ for (int j = 0; j < p->instances; j++) {
+ const short instance_id = p->instance[j];
+ if (instance_id >= 0) {
+ instance->destroy(instance_id);
+ if (instance_id < instance->instances)
+ instance->list[instance_id].owner_id = 0;
}
}