From e31428df64e6619489d7f3b89a89ac910e73b6dd Mon Sep 17 00:00:00 2001 From: Jeybla Date: Tue, 31 Jan 2017 13:55:01 +0100 Subject: [PATCH] Conf: hide favorite items while selling to NPCs (#1925) Added a configuration for hiding favorite items in the sell menu. Thanks to @Jeybla! --- conf/battle/misc.conf | 3 +++ src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/clif.c | 3 +++ 4 files changed, 8 insertions(+) diff --git a/conf/battle/misc.conf b/conf/battle/misc.conf index f12b286839..d5d56fe2fb 100644 --- a/conf/battle/misc.conf +++ b/conf/battle/misc.conf @@ -150,3 +150,6 @@ disp_servervip_msg: no // Delay to allow user resend new mail (default & minimum is 1000) mail_delay: 1000 + +// Hides items from the player's favorite tab from being sold to a NPC. (Note 1) +hide_fav_sell: no diff --git a/src/map/battle.c b/src/map/battle.c index d5b8fa8c26..ef011c2fd3 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -8405,6 +8405,7 @@ static const struct _battle_data { { "change_party_leader_samemap", &battle_config.change_party_leader_samemap, 1, 0, 1, }, { "dispel_song", &battle_config.dispel_song, 0, 0, 1, }, { "guild_maprespawn_clones", &battle_config.guild_maprespawn_clones, 0, 0, 1, }, + { "hide_fav_sell", &battle_config.hide_fav_sell, 0, 0, 1, }, #include "../custom/battle_config_init.inc" }; diff --git a/src/map/battle.h b/src/map/battle.h index 1a0520c884..b4b88a9976 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -617,6 +617,7 @@ extern struct Battle_Config int change_party_leader_samemap; int dispel_song; //Can songs be dispelled? int guild_maprespawn_clones; // Should clones be killed by maprespawnguildid? + int hide_fav_sell; #include "../custom/battle_config_struct.inc" } battle_config; diff --git a/src/map/clif.c b/src/map/clif.c index ceb0d282b2..2cbd5075e3 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1990,6 +1990,9 @@ void clif_selllist(struct map_session_data *sd) if( !itemdb_cansell(&sd->inventory.u.items_inventory[i], pc_get_group_level(sd)) ) continue; + if( battle_config.hide_fav_sell && sd->inventory.u.items_inventory[i].favorite ) + continue; //Cannot sell favs [Jey] + if( sd->inventory.u.items_inventory[i].expire_time || (sd->inventory.u.items_inventory[i].bound && !pc_can_give_bounded_items(sd)) ) continue; // Cannot Sell Rental Items or Account Bounded Items