# Bug with CBM: Electroshock Unit

**URL:** <https://discourse.cataclysmdda.org/t/bug-with-cbm-electroshock-unit/2584>\
**Category:** The Garage\
**Created:** [August 6, 2013, 7:46pm UTC](https://discourse.cataclysmdda.org/t/bug-with-cbm-electroshock-unit/2584 "2013-08-06T19:46:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacob4408](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jacob4408](https://discourse.cataclysmdda.org/u/jacob4408)\
**Post date:** [August 6, 2013, 7:46pm UTC](https://discourse.cataclysmdda.org/t/bug-with-cbm-electroshock-unit/2584/1 "2013-08-06T19:46:56Z")

</div>

Description states that this should work either unarmed OR with weapons that will conduct. From the code, it appears that it will ONLY work with unarmed. Description or (hopefully) functionality needs to be changed.

see melee.cpp:  
bool shock\_them = (has\_bionic(“bio\_shock”) && power\_level \>= 2 &&  
unarmed\_attack() && (!mon || !z-\>has\_flag(MF\_ELECTRIC)) &&  
one\_in(3));[/tt]

---

<div class="post-metadata">

**Author:** ![Whitelight](https://avatars.discourse-cdn.com/v4/letter/w/9fc348/32.png) [@Whitelight](https://discourse.cataclysmdda.org/u/Whitelight)\
**Post date:** [August 7, 2013, 1:11am UTC](https://discourse.cataclysmdda.org/t/bug-with-cbm-electroshock-unit/2584/2 "2013-08-07T01:11:56Z")

</div>

I thought i read somewhere that its description meant “unarmed weapons that conduct” which really only means adamantite claws.

---

<div class="post-metadata">

**Author:** ![drake1storm](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@drake1storm](https://discourse.cataclysmdda.org/u/drake1storm)\
**Post date:** [August 7, 2013, 1:17am UTC](https://discourse.cataclysmdda.org/t/bug-with-cbm-electroshock-unit/2584/3 "2013-08-07T01:17:13Z")

</div>

It is only meant to work with unarmed and adamantine claws.

If you want to change it, put a parenthesis before unarmed\_attack() followed by || and then a quick function to check if the player’s weapon has the steel flag (or was it metal. I can’t seem to remember. Your compiler will know). Top it all off with a closing parenthesis before the && and it should be to your liking.
