Skip to content

Commit

Permalink
Conf: hide favorite items while selling to NPCs (#1925)
Browse files Browse the repository at this point in the history
Added a configuration for hiding favorite items in the sell menu.

Thanks to @Jeybla!
  • Loading branch information
Jeybla authored and Lemongrass3110 committed Jan 31, 2017
1 parent fa443ee commit e31428d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conf/battle/misc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
Expand Down
1 change: 1 addition & 0 deletions src/map/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e31428d

Please sign in to comment.