CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.65k stars 4.18k forks source link

Pistol Bayonet is Unuseable #57119

Closed Kantonine closed 2 years ago

Kantonine commented 2 years ago

Describe the bug

Pistol bayonets don't add piercing damage on the handgun they're attached to, and don't display a damage change in menus

Steps to reproduce

  1. Find/Spawn pistol of choice
  2. Find/Spawn Pistol Bayonet
  3. Attach Bayonet
  4. Note lack of damage from bayonet on gun

Expected behavior

I expect pistol bayonets to be in line with the makeshift bayonet.

Screenshots

image

Versions and configuration

Additional context

No response

andrei8l commented 2 years ago

It's just missing a mode modifier in JSON. This seems to work:

diff --git a/data/json/items/gunmod/underbarrel.json b/data/json/items/gunmod/underbarrel.json
index 52005a446c..a3c4e1f592 100644
--- a/data/json/items/gunmod/underbarrel.json
+++ b/data/json/items/gunmod/underbarrel.json
@@ -484,6 +484,7 @@
     "mod_targets": [ "pistol" ],
     "min_skills": [ [ "weapon", 2 ], [ "melee", 1 ] ],
     "qualities": [ [ "CUT", 1 ], [ "BUTCHER", 15 ] ],
+    "mode_modifier": [ [ "REACH", "bayonet", 1, [ "MELEE" ] ] ],
     "flags": [ "STAB" ]
   },
   {