diff options
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/char.c | 6 | ||||
-rw-r--r-- | src/char_sql/int_party.c | 27 |
2 files changed, 19 insertions, 14 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index dd5b31770..3edc30c9c 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -4384,7 +4384,7 @@ int char_family(int pl1,int pl2,int pl3) { (pl3 == partnerid && pl2 == childid)
) {
mysql_free_result (sql_res);
- return 1;
+ return childid;
}
}
if(charid == pl2) {
@@ -4392,7 +4392,7 @@ int char_family(int pl1,int pl2,int pl3) { (pl3 == partnerid && pl1 == childid)
) {
mysql_free_result (sql_res);
- return 1;
+ return childid;
}
}
if(charid == pl3) {
@@ -4400,7 +4400,7 @@ int char_family(int pl1,int pl2,int pl3) { (pl2 == partnerid && pl1 == childid)
) {
mysql_free_result (sql_res);
- return 1;
+ return childid;
}
}
}
diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c index fe46ac9c6..3ea997229 100644 --- a/src/char_sql/int_party.c +++ b/src/char_sql/int_party.c @@ -18,8 +18,8 @@ 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 party_data *party_pt;
@@ -74,17 +74,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;i<MAX_PARTY;i++){
- lv=p->party.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.
@@ -94,6 +89,18 @@ static void int_party_calc_state(struct party_data *p) p->party.member[2].char_id
);
}
+ //max/min levels.
+ for(i=0;i<MAX_PARTY;i++){
+ lv=p->party.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.
@@ -346,9 +353,7 @@ struct party_data* search_partyname(char *str) // 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);
}
// Is there any member in the party?
|