diff options
author | Smokexyz <sagunkho@hotmail.com> | 2017-04-04 15:15:06 +0800 |
---|---|---|
committer | Smokexyz <sagunkho@hotmail.com> | 2017-04-04 17:00:43 +0800 |
commit | 176b7f571307000a8a22cf133041a911127fac5b (patch) | |
tree | 9964183dfe53dbb66acf169e56fa54a2979de77c /src/map | |
parent | 20145c61053479b9acd8ed50c75a80c2a861e349 (diff) | |
download | hercules-176b7f571307000a8a22cf133041a911127fac5b.tar.gz hercules-176b7f571307000a8a22cf133041a911127fac5b.tar.bz2 hercules-176b7f571307000a8a22cf133041a911127fac5b.tar.xz hercules-176b7f571307000a8a22cf133041a911127fac5b.zip |
Unequip arrows when a bow is unequipped. (RE only)
Forces the unequipment of arrows when a bow is unequipped.
Based on original PR by @Jedzkie in #1079
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 2 | ||||
-rw-r--r-- | src/map/pc.c | 5 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 64fda033f..c2e35842b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7320,6 +7320,7 @@ static const struct battle_data { { "save_body_style", &battle_config.save_body_style, 0, 0, 1, }, { "player_warp_keep_direction", &battle_config.player_warp_keep_direction, 0, 0, 1, }, { "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, }, + { "bow_unequip_arrow", &battle_config.bow_unequip_arrow, 1, 0, 1, }, { "max_summoner_parameter", &battle_config.max_summoner_parameter, 120, 10, 10000, }, }; #ifndef STATS_OPT_OUT diff --git a/src/map/battle.h b/src/map/battle.h index c55d5ef19..1a9b83111 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -545,6 +545,8 @@ struct Battle_Config { int player_warp_keep_direction; int atcommand_levelup_events; // Enable atcommands trigger level up events for NPCs + + int bow_unequip_arrow; int max_summoner_parameter; // Summoner Max Stats }; diff --git a/src/map/pc.c b/src/map/pc.c index 2cf5d75b4..837438b3d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -10036,6 +10036,11 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) status_change_end(&sd->bl, SC_ARMOR_RESIST, INVALID_TIMER); } +#ifdef RENEWAL + if (battle->bc->bow_unequip_arrow && pos&EQP_ARMS && sd->equip_index[EQI_AMMO] > 0) + pc->unequipitem(sd, sd->equip_index[EQI_AMMO], PCUNEQUIPITEM_FORCE); +#endif + if( sd->state.autobonus&pos ) sd->state.autobonus &= ~sd->status.inventory[n].equip; //Check for activated autobonus [Inkfish] |