Bladeren bron

Conf: hide favorite items while selling to NPCs (#1925)

Added a configuration for hiding favorite items in the sell menu.

Thanks to @Jeybla!
Jeybla 8 jaren geleden
bovenliggende
commit
e31428df64
4 gewijzigde bestanden met toevoegingen van 8 en 0 verwijderingen
  1. 3 0
      conf/battle/misc.conf
  2. 1 0
      src/map/battle.c
  3. 1 0
      src/map/battle.h
  4. 3 0
      src/map/clif.c

+ 3 - 0
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

+ 1 - 0
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"
 };

+ 1 - 0
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;

+ 3 - 0
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