summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
authorKirieZ <guilherme.menaldo@outlook.com>2016-12-18 18:54:40 -0200
committerKirieZ <guilherme.menaldo@outlook.com>2016-12-18 18:54:40 -0200
commitea449a7a5720335ff1b19ef0f3b97361c606355e (patch)
treefb7f341d8f8f3fbde19bb46175f18a374925a457 /src/map/party.c
parent9795505a14327d5d2603a1d756633485e7e2ba94 (diff)
downloadhercules-ea449a7a5720335ff1b19ef0f3b97361c606355e.tar.gz
hercules-ea449a7a5720335ff1b19ef0f3b97361c606355e.tar.bz2
hercules-ea449a7a5720335ff1b19ef0f3b97361c606355e.tar.xz
hercules-ea449a7a5720335ff1b19ef0f3b97361c606355e.zip
Changed behavior when party leader leaves it from party being disbanded to leader being changed to the second user. Closes #1107
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/party.c b/src/map/party.c
index 3bf9542c7..1a9ac1cbe 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -300,6 +300,18 @@ int party_recv_info(const struct party *sp, int char_id)
if (i == MAX_PARTY)
added[added_count++] = member_id;
}
+
+ ARR_FIND(0, MAX_PARTY, j, p->party.member[j].leader == 1);
+ if( j == MAX_PARTY ) {
+ // Leader has changed
+ int i;
+ ARR_FIND(0, MAX_PARTY, i, sp->member[i].leader == 1);
+ if( i < MAX_PARTY ) {
+ clif->PartyLeaderChanged(map->id2sd(sp->member[i].account_id), 0, sp->member[i].account_id);
+ } else {
+ party->broken(p->party.party_id); // Should not happen, Party is leaderless, disband
+ }
+ }
} else {
for( member_id = 0; member_id < MAX_PARTY; ++member_id )
if( sp->member[member_id].char_id != 0 )