summaryrefslogtreecommitdiff
path: root/src/map/party.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-06-28 03:32:35 +0200
committerGitHub <noreply@github.com>2020-06-28 03:32:35 +0200
commit92022a5728dbd3a2e95b007276cd4eb926885bac (patch)
tree942830c72893a6041d693371a1147a9023cec0bc /src/map/party.c
parent9b22213254d64b2c155c6700030303852fd5b912 (diff)
parentddf679b3808e56309a7352eead2cd1f93c9f99c9 (diff)
downloadhercules-92022a5728dbd3a2e95b007276cd4eb926885bac.tar.gz
hercules-92022a5728dbd3a2e95b007276cd4eb926885bac.tar.bz2
hercules-92022a5728dbd3a2e95b007276cd4eb926885bac.tar.xz
hercules-92022a5728dbd3a2e95b007276cd4eb926885bac.zip
Merge pull request #2757 from Kenpachi2k13/server_messages
Adjust server messages on login and map change
Diffstat (limited to 'src/map/party.c')
-rw-r--r--src/map/party.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/map/party.c b/src/map/party.c
index a6f6b7774..5eecd3fe6 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -330,6 +330,8 @@ static int party_recv_info(const struct party *sp, int char_id)
party->member_withdraw(sp->party_id, sd->status.account_id, sd->status.char_id);
}
+ int option_auto_changed = p->state.option_auto_changed; // Preserve state.
+
memcpy(&p->party, sp, sizeof(struct party));
memset(&p->state, 0, sizeof(p->state));
memset(&p->data, 0, sizeof(p->data));
@@ -342,6 +344,7 @@ static int party_recv_info(const struct party *sp, int char_id)
p->party.member[member_id].leader = 1;
}
party->check_state(p);
+ p->state.option_auto_changed = option_auto_changed;
while( added_count > 0 ) { // new in party
member_id = added[--added_count];
sd = p->data[member_id].sd;
@@ -349,7 +352,6 @@ static int party_recv_info(const struct party *sp, int char_id)
continue;// not online
clif->charnameupdate(sd); //Update other people's display. [Skotlex]
clif->party_member_info(p,sd);
- clif->party_option(p,sd,0x100);
clif->party_info(p,NULL);
for( j = 0; j < p->instances; j++ ) {
if( p->instance[j] >= 0 ) {
@@ -492,6 +494,8 @@ static void party_member_joined(struct map_session_data *sd)
}
} else
sd->status.party_id = 0; //He does not belongs to the party really?
+
+ party->send_movemap(sd);
}
/// Invoked (from char-server) when a new member is added to the party.
@@ -532,6 +536,11 @@ static int party_member_added(int party_id, int account_id, int char_id, int fla
clif->party_member_info(p,sd);
clif->party_info(p,sd);
+ if (p->state.option_auto_changed != 0)
+ clif->party_option(p, sd, 0x04);
+ else
+ clif->party_option(p, sd, 0x08);
+
if( sd2 != NULL )
clif->party_inviteack(sd2,sd->status.name,2);
@@ -616,6 +625,7 @@ static int party_member_withdraw(int party_id, int account_id, int char_id)
prev_leader_accountId = p->party.member[i].account_id;
}
+ clif->party_option(p, sd, 0x10);
clif->party_withdraw(p,sd,account_id,p->party.member[i].name,0x0);
memset(&p->party.member[i], 0, sizeof(p->party.member[0]));
memset(&p->data[i], 0, sizeof(p->data[0]));
@@ -723,8 +733,17 @@ static int party_optionchanged(int party_id, int account_id, int exp, int item,
//Flag&0x1: Exp change denied. Flag&0x10: Item change denied.
if(!(flag&0x01) && p->party.exp != exp)
p->party.exp=exp;
- if(!(flag&0x10) && p->party.item != item) {
+ if (p->party.item != item)
p->party.item=item;
+
+ if (account_id == 0) {
+ flag |= 0x04;
+ p->state.option_auto_changed = 1;
+
+ if (p->state.member_level_changed == 0)
+ return 0; // clif_party_option() is handled in clif_parse_LoadEndAck().
+ } else {
+ flag |= 0x02;
}
clif->party_option(p,sd,flag);
@@ -805,7 +824,8 @@ static int party_recv_movemap(int party_id, int account_id, int char_id, unsigne
ShowError("party_recv_movemap: char %d/%d not found in party %s (id:%d)",account_id,char_id,p->party.name,party_id);
return 0;
}
-
+
+ p->state.member_level_changed = 0;
m = &p->party.member[i];
m->map = mapid;
m->online = online;
@@ -854,7 +874,12 @@ static void party_send_movemap(struct map_session_data *sd)
static void party_send_levelup(struct map_session_data *sd)
{
- intif->party_changemap(sd,1);
+ struct party_data *p = party->search(sd->status.party_id);
+
+ if (p != NULL)
+ p->state.member_level_changed = 1;
+
+ intif->party_changemap(sd, 1);
}
static int party_send_logout(struct map_session_data *sd)