From 42e1d3fd8849d608dc1e4136b0acc99b8649f083 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 23 Oct 2006 18:21:49 +0000 Subject: - char_family now returns the char_id of the children when previously it would return true. - Expanded the family check to work as it should, exp-share-range is respected, and the child is not considered for it (thanks to TheUltraMage for the investigation) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9049 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char/int_party.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'src/char/int_party.c') diff --git a/src/char/int_party.c b/src/char/int_party.c index cae69193f..13fbaf489 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -20,8 +20,8 @@ char party_txt[1024] = "save/party.txt"; struct party_data { struct party party; unsigned int min_lv, max_lv; + int family; //Is this party a family? if so, this holds the child id. unsigned char size; //Total size of party. - unsigned family :1; //Is this party a family? }; static struct dbt *party_db; @@ -67,17 +67,12 @@ static void int_party_calc_state(struct party_data *p) p->size = p->family = 0; - //Check party size, max/min levels. + //Check party size. for(i=0;iparty.member[i].lv; - if (!lv) continue; + if (!p->party.member[i].lv) continue; p->size++; if(p->party.member[i].online) - { - if( lv < p->min_lv ) p->min_lv=lv; - if( p->max_lv < lv ) p->max_lv=lv; p->party.count++; - } } if(p->size == 3) { //Check Family State. @@ -87,6 +82,18 @@ static void int_party_calc_state(struct party_data *p) p->party.member[2].char_id ); } + //max/min levels. + for(i=0;iparty.member[i].lv; + if (!lv) continue; + if(p->party.member[i].online && + //On families, the kid is not counted towards exp share rules. + p->party.member[i].char_id != p->family) + { + if( lv < p->min_lv ) p->min_lv=lv; + if( p->max_lv < lv ) p->max_lv=lv; + } + } if (p->party.exp && !party_check_exp_share(p)) { p->party.exp = 0; //Set off even share. @@ -257,11 +264,9 @@ struct party_data* search_partyname(char *str) { return p; } -// EXP公平分配できるかチェック +// Returns whether this party can keep having exp share or not. int party_check_exp_share(struct party_data *p) { - return (p->party.count == 0 || //If noone is online, don't mess with the share type. - (p->family && p->party.count == 3) || //All 3 MUST be online for share to trigger. - p->max_lv - p->min_lv <= party_share_level); + return (p->party.count < 2|| p->max_lv - p->min_lv <= party_share_level); } // パ?ティが空かどうかチェック -- cgit v1.2.3-70-g09d2