Issue information

Issue ID
#4084
Status
Fixed
Severity
Fair
Started
Hercules Elf Bot
Mar 3, 2010 4:18
Last Post
Hercules Elf Bot
Apr 4, 2012 8:34
Confirmation
N/A

Hercules Elf Bot - Mar 3, 2010 4:18

Originally posted by [b]RoM[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4084

There are 2 bug's:
- We can only share by setting share before inviting baby to party.
- We can only share by having the whole family in the party, but according to iRO Wiki:
"The child will be able to share with either (or both) of their Parents at any given level"

Source: http://irowiki.org/wiki/Adoption_System


Fixes:
CODE
Index: char/int_party.c
===================================================================
@@ -41,7 +41,7 @@
    p->min_lv = UINT_MAX;
    p->max_lv = 0;
    for(i=0;i<MAX_PARTY;i++){
-        if(!p->party.member[i].online)
+        if(!p->party.member[i].online || p->party.member[i].char_id == p->family) // Also ignore child level. [RoM]
            continue;

        lv=p->party.member[i].lv;
@@ -83,6 +83,15 @@
            p->party.member[2].char_id
        );
    }
+    if(p->size == 2) {
+        // The child will be able to share with either of their Parents. [RoM]
+        if(char_child(p->party.member[0].char_id,p->party.member[1].char_id) || char_child(p->party.member[1].char_id,p->party.member[2].char_id)) {
+            if(p->party.member[0].class_&0x2000) // See who's the child.
+                p->family = p->party.member[0].char_id;
+            else
+                p->family = p->party.member[1].char_id;
+        }
+    }
    //max/min levels.
    for(i=0;i<MAX_PARTY;i++){
        lv=p->party.member[i].lv;
@@ -266,7 +275,7 @@

// Returns whether this party can keep having exp share or not.
int party_check_exp_share(struct party_data *p) {
-    return (p->party.count < 2|| p->max_lv - p->min_lv <= party_share_level);
+    return (p->party.count < 2 || p->max_lv - p->min_lv <= party_share_level);
}

// ƒp?ƒeƒB‚ª‹ó‚©‚Ç‚¤‚©ƒ`ƒFƒbƒN
@@ -517,7 +526,7 @@
    p->party.member[i].leader = 0;
    if (p->party.member[i].online) p->party.count++;
    p->size++;
-    if (p->size == 3) //Check family state.
+    if (p->size == 2 || p->size == 3) // Check family state. And also accept either of their Parents. [RoM]
        int_party_calc_state(p);
    else //Check even share range.
    if (member->lv < p->min_lv || member->lv > p->max_lv || p->family) {


Index: char_sql/int_party.c
===================================================================
@@ -42,7 +42,7 @@
    p->min_lv = UINT_MAX;
    p->max_lv = 0;
    for(i=0;i<MAX_PARTY;i++){
-        if(!p->party.member[i].online)
+        if(!p->party.member[i].online || p->party.member[i].char_id == p->family) // Also ignore child level. [RoM]
            continue;

        lv=p->party.member[i].lv;
@@ -83,6 +83,15 @@
            p->party.member[2].char_id
        );
    }
+    if(p->size == 2) {
+        // The child will be able to share with either of their Parents. [RoM]
+        if(char_child(p->party.member[0].char_id,p->party.member[1].char_id) || char_child(p->party.member[1].char_id,p->party.member[2].char_id)) {
+            if(p->party.member[0].class_&0x2000) // See who's the child.
+                p->family = p->party.member[0].char_id;
+            else
+                p->family = p->party.member[1].char_id;
+        }
+    }
    //max/min levels.
    for(i=0;i<MAX_PARTY;i++){
        lv=p->party.member[i].lv;
@@ -550,7 +559,7 @@
    p->party.member[i].leader = 0;
    if (p->party.member[i].online) p->party.count++;
    p->size++;
-    if (p->size == 3) //Check family state.
+    if (p->size == 2 || p->size == 3) // Check family state. And also accept either of their Parents. [RoM]
        int_party_calc_state(p);
    else //Check even share range.
    if (member->lv < p->min_lv || member->lv > p->max_lv || p->family) {

Hercules Elf Bot - Dec 8, 2011 18:06

Originally posted by [b]Ind[/b]
Fixed in [rev=15029]