# Valid mods for a pistol crossbow?

**URL:** https://discourse.cataclysmdda.org/t/valid-mods-for-a-pistol-crossbow/15905
**Category:** The Bunker
**Created:** [July 15, 2018, 10:53pm UTC](https://discourse.cataclysmdda.org/t/valid-mods-for-a-pistol-crossbow/15905 "2018-07-15T22:53:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)
#### Post date: [July 15, 2018, 10:53pm UTC](https://discourse.cataclysmdda.org/t/valid-mods-for-a-pistol-crossbow/15905/1 "2018-07-15T22:53:01Z")

</div>

So my new NPC has Pistols 8. Fine, I say, I have skills, I’ll make and mod a pistol crossbow.

I try putting a rail laser sight on it. Nope, mod too big for the gun.  
I try putting a underbarrel laser sight on it. Nope, mod too big for the gun.  
I try putting a combat knife on it. Nope, “cannot have a combat knife.”  
I try an old makeshift bayonet. Nope, “cannot have a makeshift bayonet.”  
out of desperation,I try some iron sights. “Nope, isn’t big enough for that mod.”

A pistol crossbow has a rail slot, an underbarrel slot, a grip slot, a sights slot, and a stock slot. I went back and checked the json: it has the exact same “valid\_mod\_locations” as a normal crossbow.

So what mods are you supposed to mount on a pistol crossbow?

---

<div class="post-metadata">

### Author: ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)
#### Post date: [July 15, 2018, 10:56pm UTC](https://discourse.cataclysmdda.org/t/valid-mods-for-a-pistol-crossbow/15905/2 "2018-07-15T22:56:14Z")

</div>

Never mind, realized my character has Pistol 0 and doesn’t know how to mount them. Annoying but I can deal with it.^U^U

Nope, debugged myself a higher handguns skill, still can’t do it. Increased the volume of the pistol crossbow to 1.5L, weight to 4 lbs, still can’t.

$ git grep -C 1 hand\_crossbow src

```
src/item.cpp-
src/item.cpp: } else if( typeId() == "hand_crossbow" && !!mod.type->gunmod->usable.count( pistol_gun_type ) ) {
src/item.cpp- return ret_val<bool>::make_failure( _("isn't big enough to use that mod") );

```

Nice double negation there. Okay, that explains it.

---

<div class="post-metadata">

### Author: ![darktoes](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@darktoes](https://discourse.cataclysmdda.org/u/darktoes)
#### Post date: [July 15, 2018, 11:57pm UTC](https://discourse.cataclysmdda.org/t/valid-mods-for-a-pistol-crossbow/15905/3 "2018-07-15T23:57:34Z")

</div>

Well now that’s pretty weird. I guess I kinda get it, but it seems silly considering all the other shit we can put mods on.

---

<div class="post-metadata">

### Author: ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)
#### Post date: [July 16, 2018, 12:18am UTC](https://discourse.cataclysmdda.org/t/valid-mods-for-a-pistol-crossbow/15905/4 "2018-07-16T00:18:33Z")

</div>

No, it’s a bug.  
It’s supposed to read  
if( typeId() == “hand\_crossbow” && !mod.type-\>gunmod-\>usable.count( pistol\_gun\_type ) ) {

ie, if it’s a hand crossbow and you’re trying to use a gunmod that isn’t a pistol mod, then it’s too big.  
The double !! is the equivalent of  
if( typeId() == “hand\_crossbow” && mod.type-\>gunmod-\>usable.count( pistol\_gun\_type ) ) {

ie, if its’ a hand crossbow and you’re trying to use a gunmod that is a pistol mod, then it’s too big.

Obvious bug because someone typo’d the negation. These things happen. I’ve submitted a PR to fix it: [https://github.com/CleverRaven/Cataclysm-DDA/pull/24314](https://github.com/CleverRaven/Cataclysm-DDA/pull/24314)

---

<div class="post-metadata">

### Author: ![darktoes](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@darktoes](https://discourse.cataclysmdda.org/u/darktoes)
#### Post date: [July 16, 2018, 12:54am UTC](https://discourse.cataclysmdda.org/t/valid-mods-for-a-pistol-crossbow/15905/5 "2018-07-16T00:54:16Z")

</div>

Ah I see, I didn’t look that closely. That definitely looks like an oops.
