summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/int_party.c71
1 files changed, 37 insertions, 34 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 8f8e22583..5b04467b2 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -637,43 +637,46 @@ int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id
if (p == NULL)
return 0;
- for(i = 0; i < MAX_PARTY; i++) {
- if(p->party.member[i].account_id == account_id &&
- p->party.member[i].char_id == char_id)
+ for(i = 0; i < MAX_PARTY &&
+ (p->party.member[i].account_id != account_id ||
+ p->party.member[i].char_id != char_id); i++);
+
+ if (i == MAX_PARTY) return 0;
+
+ if (p->party.member[i].online != online)
+ {
+ p->party.member[i].online = online;
+ if (online)
+ p->party.count++;
+ else
+ p->party.count--;
+ // Even share check situations: Family state (always breaks)
+ // character logging on/off is max/min level (update level range)
+ // or character logging on/off has a different level (update level range using new level)
+ if (p->family ||
+ (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) ||
+ (p->party.member[i].lv != lv && (lv <= p->min_lv || lv >= p->max_lv))
+ )
{
- p->party.member[i].map = map;
- if (p->party.member[i].online != online)
- {
- p->party.member[i].online = online;
- if (online)
- p->party.count++;
- else
- p->party.count--;
- // Even share check situations: Family state (always breaks)
- // character logging on/off is max/min level (update level range)
- // or character logging on/off has a different level (update level range using new level)
- if (p->family ||
- (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) ||
- (p->party.member[i].lv != lv && (lv <= p->min_lv || lv >= p->max_lv))
- )
- {
- p->party.member[i].lv = lv;
- int_party_check_lv(p);
- }
- }
- if (p->party.member[i].lv != lv) {
- if(p->party.member[i].lv == p->min_lv ||
- p->party.member[i].lv == p->max_lv)
- {
- p->party.member[i].lv = lv;
- int_party_check_lv(p);
- } else
- p->party.member[i].lv = lv;
- }
- mapif_party_membermoved(&p->party, i);
- break;
+ p->party.member[i].lv = lv;
+ int_party_check_lv(p);
}
}
+ if (p->party.member[i].lv != lv) {
+ if(p->party.member[i].lv == p->min_lv ||
+ p->party.member[i].lv == p->max_lv)
+ {
+ p->party.member[i].lv = lv;
+ int_party_check_lv(p);
+ } else
+ p->party.member[i].lv = lv;
+ //There is no need to send level update to map servers
+ //since they do nothing with it.
+ }
+ if (p->party.member[i].map != map) {
+ p->party.member[i].map = map;
+ mapif_party_membermoved(&p->party, i);
+ }
return 0;
}