diff options
-rw-r--r-- | Changelog-Trunk.txt | 4 | ||||
-rw-r--r-- | conf-tmpl/battle/player.conf | 5 | ||||
-rw-r--r-- | src/map/battle.c | 2 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/clif.c | 19 |
5 files changed, 30 insertions, 1 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 895731d53..450272e6b 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,10 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2006/09/15 + * Added config setting "friend_auto_add" (battle/player.conf), if set, when + you accept someone as your friend, both characters will show up on each + other's friend list. [Skotlex] 2006/09/14
* Changed Extremity Fist's code to make you actually walk past your target, which displays a much more correct "animation" for the skill. Thanks to diff --git a/conf-tmpl/battle/player.conf b/conf-tmpl/battle/player.conf index 2446c647a..3e816a40b 100644 --- a/conf-tmpl/battle/player.conf +++ b/conf-tmpl/battle/player.conf @@ -123,6 +123,11 @@ show_hp_sp_drain: no // Display the gained hp/sp values from killing mobs? (Ie: Sky Deleter Card)
show_hp_sp_gain: yes
+
+// If set, when A accepts B as a friend, B will also be added to A's friend
+// list, otherwise, only A appears in B's friend list.
+friend_auto_add: no
+
// Are other requests accepted during [various things[party,guild]] a request or not?
// It does not accept by no accepted by yes.
invite_request_check: yes
diff --git a/src/map/battle.c b/src/map/battle.c index badf117ed..f44493cb3 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3769,6 +3769,7 @@ static const struct battle_data_short { { "autospell_stacking", &battle_config.autospell_stacking }, { "override_mob_names", &battle_config.override_mob_names }, { "min_chat_delay", &battle_config.min_chat_delay }, + { "friend_auto_add", &battle_config.friend_auto_add }, { "homunculus_show_growth", &battle_config.homunculus_show_growth }, //[orn] { "homunculus_friendly_rate", &battle_config.homunculus_friendly_rate }, }; @@ -4208,6 +4209,7 @@ void battle_set_defaults() { battle_config.autospell_stacking = 0; battle_config.override_mob_names = 0; battle_config.min_chat_delay = 0; + battle_config.friend_auto_add = 0; battle_config.hvan_explosion_intimate = 45000; //[orn] battle_config.homunculus_show_growth = 0; //[orn] battle_config.homunculus_friendly_rate = 100; diff --git a/src/map/battle.h b/src/map/battle.h index 2d851176a..130ec2d4d 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -439,6 +439,7 @@ extern struct Battle_Config { unsigned short autospell_stacking; //Enables autospell cards to stack. [Skotlex]
unsigned short override_mob_names; //Enables overriding spawn mob names with the mob_db names. [Skotlex]
unsigned short min_chat_delay; //Minimum time between client messages. [Skotlex]
+ unsigned short friend_auto_add; //When accepting friends, both get friended. [Skotlex]
unsigned int hvan_explosion_intimate ; // fix [albator]
unsigned short homunculus_show_growth ; //[orn]
unsigned short homunculus_friendly_rate;
diff --git a/src/map/clif.c b/src/map/clif.c index ac76dd9f2..366da63df 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11281,7 +11281,24 @@ void clif_parse_FriendsListReply(int fd, struct map_session_data *sd) { memcpy(f_sd->status.friends[i].name, sd->status.name, NAME_LENGTH);
clif_friendslist_reqack(f_sd, sd, 0);
-// clif_friendslist_send(sd); //This is not needed anymore.
+ if (battle_config.friend_auto_add) {
+ // Also add f_sd to sd's friendlist.
+ for (i = 0; i < MAX_FRIENDS; i++) {
+ if (sd->status.friends[i].char_id == f_sd->status.char_id)
+ return; //No need to add anything.
+ if (sd->status.friends[i].char_id == 0)
+ break;
+ }
+ if (i == MAX_FRIENDS) {
+ clif_friendslist_reqack(sd, f_sd, 2);
+ return;
+ }
+
+ sd->status.friends[i].account_id = f_sd->status.account_id;
+ sd->status.friends[i].char_id = f_sd->status.char_id;
+ memcpy(sd->status.friends[i].name, f_sd->status.name, NAME_LENGTH);
+ clif_friendslist_reqack(sd, f_sd, 0);
+ }
}
return;
|