diff options
author | Jedzkie <jedzkie13@rocketmail.com> | 2020-06-23 08:00:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 08:00:00 +0800 |
commit | 520863eaeda83da14b88d09f6378cd8abd5a5174 (patch) | |
tree | 2496ea36744dc2f51d264741a78699e719ceeb3b /src/map/party.c | |
parent | 0b7768837bed2aa521de5b9b76b2348943d7db20 (diff) | |
parent | 9b89425550094f51d633e5b5d6e86af65bffbf39 (diff) | |
download | hercules-520863eaeda83da14b88d09f6378cd8abd5a5174.tar.gz hercules-520863eaeda83da14b88d09f6378cd8abd5a5174.tar.bz2 hercules-520863eaeda83da14b88d09f6378cd8abd5a5174.tar.xz hercules-520863eaeda83da14b88d09f6378cd8abd5a5174.zip |
Merge branch 'master' into jedzkie-pr03
Diffstat (limited to 'src/map/party.c')
-rw-r--r-- | src/map/party.c | 17 |
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; } } |