summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.cpp21
-rw-r--r--src/map/pc.cpp8
2 files changed, 18 insertions, 11 deletions
diff --git a/src/map/battle.cpp b/src/map/battle.cpp
index b745e05..16481a9 100644
--- a/src/map/battle.cpp
+++ b/src/map/battle.cpp
@@ -2060,18 +2060,21 @@ ATK battle_weapon_attack(dumb_ptr<block_list> src, dumb_ptr<block_list> target,
// 攻撃対象となりうるので攻撃 | Attack because it can be attacked
if (sd && sd->status.weapon == ItemLook::W_BOW)
{
- IOff0 aidx = sd->equip_index_maybe[EQUIP::ARROW];
- if (aidx.ok())
+ IOff0 widx = sd->equip_index_maybe[EQUIP::WEAPON];
+ if (!bool(itemdb_search(sd->status.inventory[widx].nameid)->mode & ItemMode::DONT_USE_AMMO))
{
- if (battle_config.arrow_decrement)
- pc_delitem(sd, aidx, 1, 0);
- }
- else
- {
- clif_arrow_fail(sd, 0);
- return ATK::ZERO;
+ IOff0 aidx = sd->equip_index_maybe[EQUIP::ARROW];
+ if (aidx.ok())
+ if (battle_config.arrow_decrement)
+ pc_delitem(sd, aidx, 1, 0);
+ else
+ {
+ clif_arrow_fail(sd, 0);
+ return ATK::ZERO;
+ }
}
}
+
wd = battle_calc_weapon_attack(src, target, SkillID::ZERO, 0, 0);
// significantly increase injuries for hasted characters
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 12af48f..9105d05 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -2404,8 +2404,12 @@ int pc_useitem(dumb_ptr<map_session_data> sd, IOff0 n)
}
P<const ScriptBuffer> script = borrow(*sdidn->use_script);
- clif_useitemack(sd, n, amount - 1, 1);
- pc_delitem(sd, n, 1, 1);
+
+ if (!bool(itemdb_search(sd->status.inventory[n].nameid)->mode & ItemMode::KEEP_AFTER_USE))
+ {
+ clif_useitemack(sd, n, amount - 1, 1);
+ pc_delitem(sd, n, 1, 1);
+ }
// activity
if (sd)