# Battery system CBM possible bug

**URL:** https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722
**Category:** The Garage
**Created:** [July 22, 2021, 12:31am UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722 "2021-07-22T00:31:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![DickWarlord](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@DickWarlord](https://discourse.cataclysmdda.org/u/DickWarlord)
#### Post date: [July 22, 2021, 12:31am UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722/1 "2021-07-22T00:31:52Z")

</div>

Hey there everyone!  
So, I’m starting this post so someone can explain me how the battery system CBM works. The description says I can consume the batteries (also a quick google revealed me that it’s through the shift+E menu), but whenever I try, it says they’re not edible.  
So maybe, I thought, I have to activate the CBM on the menu, but it says that the battery system doesn’t have enough fuel to start (I have 100 kJ bionic energy ATM), so even that is a no-go.  
So, I ask thee, the CDDA forum experts: what am I doing wrong? Is this a bug? I was writing an issue on github but then I thought “what if I’m just an idiot and the devs will hate me for it?”, SO I came here instead!

---

<div class="post-metadata">

### Author: ![TaintedHolyWater](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@TaintedHolyWater](https://discourse.cataclysmdda.org/u/TaintedHolyWater)
#### Post date: [July 22, 2021, 2:19am UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722/2 "2021-07-22T02:19:44Z")

</div>

Here is a picture to help explain  
A: It’s internal charge. This X/2000 charge is spent by the bionic and refilled by "E"ating charged batteries. If it’s full you can’t eat any more batteries until you use up some of it’s charge.  
B: The Battery System. Activating this drains it’s charge (B) to refill your bionic power (C). If you have any other power sources then I recommend an auto on/off like the one shown (Set with “A” and “S”) to save it’s charge as a backup.  
C: Your bionic charge: The 100 kJ you mentioned is used to power other bionics that consume bionic charge (Lazer finger, heat sink, vibro-jackhammer thing, exc) instead of making it.

 ![tempsnip](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/e/e819c01a95ab24810e132fa8bba7532e3f685e9d.png)

_Edited to fix the A and B labels_

---

<div class="post-metadata">

### Author: ![Robik](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/robik/32/1349_2.png) [@Robik](https://discourse.cataclysmdda.org/u/Robik)
#### Post date: [July 22, 2021, 6:52am UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722/3 "2021-07-22T06:52:17Z")

</div>

> <https://github.com/CleverRaven/Cataclysm-DDA/issues/49905>
>
> \### Describe the bug
> 
> You can't 'eat' batteries to store battery power and sub…sequently you can't activate CBM to reload from stored battery power, because you have none.
> 
> \### Steps To Reproduce
> 
> 1. start with Bionic Game Master to have CBM
> 2. spawn some batteries to your inventory
> 3. try to 'E'at batteries - they are grayed out
> 4. try to use 'R'efuel in Bionics menu, you get "You have no fuel to consume" popup.
> 
> \### Expected behavior
> 
> You should be able to either consume batteries by eating or by refuelling to store battery power.
> 
> \### Screenshots
> 
> \_No response\_
> 
> \### Versions and configuration
> 
> \- OS: Windows
> - OS Version: 7
> \- Game Version: 4abcc6f \[64-bit\]
> \- Graphics Version: Tiles
> \- Game Language: English \[en\]
> \- Mods loaded: \[
> Dark Days Ahead \[dda\],
> Disable NPC Needs \[no\_npc\_food\],
> Bionic Professions \[package\_bionic\_professions\]
> \]
> 
> 
> \### Additional context
> 
> Commented about it in #49789. Was told CBM works by reloading from 'stored battery power', which is gained by eating batteries. Never used this CBM before, so despite trying my best with bug description and expected behavior, it might be unintentionaly wrong.
> 
> Probably related to #48750

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/49942>
>
> \#### Summary
> Bugfixes "Fix Battery System CBM refueling"
> 
> \#### Purpose of cha…nge
> Fixes #49905
> EDIT: Tested the gasoline CBM and it seems to be working:
> Fixes #49789
> 
> \#### Describe the solution
> There were two issues:
> \* Batteries weren't being listed in the refueling menu because a second item filter was filtering any items that weren't considered fuel (\`item::is\_fuel()\`) while another filter already checked that the items were valid CBM refueling items. The \`item::is\_fuel()\` function only checks the item materials, not the contents of magazine-based fuel items so it was discarding batteries, so removing this second check allowed listing batteries.
> \* A similar thing happened when checking if the item had fuel available and the player had enough fuel capacity. Fixing the first part showed a message about not having enough capacity for the fuel. Adding checks for magazine contents when getting the denial message fixes this second issue.
> 
> \#### Describe alternatives you've considered
> Ordering delivery. I'm hungry.
> 
> \#### Testing
> !\[image\](https://user-images.githubusercontent.com/1606943/125684632-61bee9c3-987d-47cf-aec6-73e2bb490da8.png)
> 
> !\[image\](https://user-images.githubusercontent.com/1606943/125699886-3b680283-f3e3-4e23-a3e1-1ed8b23ff573.png)
> 
> Eat menu now discards non-comestible items, including fuels:
> !\[image\](https://user-images.githubusercontent.com/1606943/125761782-56b06381-e471-404f-9533-beb747d2952d.png)

Fix for your issue is already done, but is not merged into the game yet.

New way to consume batteries will be available in Bionics menu via refueling.

---

<div class="post-metadata">

### Author: ![DickWarlord](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@DickWarlord](https://discourse.cataclysmdda.org/u/DickWarlord)
#### Post date: [July 22, 2021, 10:02am UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722/4 "2021-07-22T10:02:45Z")

</div>

Ah, that’s good to know! Thanks a lot!

---

<div class="post-metadata">

### Author: ![TaintedHolyWater](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@TaintedHolyWater](https://discourse.cataclysmdda.org/u/TaintedHolyWater)
#### Post date: [July 23, 2021, 12:47am UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722/5 "2021-07-23T00:47:55Z")

</div>

Oh. I’m on the experimental build through the game launcher 🤦‍♂️ That explains why it worked fine on my end, sorry for not mentioning that. At least it means the fix works well on experimental and the next stable release.

---

<div class="post-metadata">

### Author: ![DickWarlord](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@DickWarlord](https://discourse.cataclysmdda.org/u/DickWarlord)
#### Post date: [July 23, 2021, 12:22pm UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722/6 "2021-07-23T12:22:01Z")

</div>

Yeah…thing is, I am also playing on last experimental. Also created a debug character, gave him the proper bionics, did the self install procedure and a small battery and…same message again.

---

<div class="post-metadata">

### Author: ![TaintedHolyWater](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@TaintedHolyWater](https://discourse.cataclysmdda.org/u/TaintedHolyWater)
#### Post date: [July 23, 2021, 4:26pm UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722/7 "2021-07-23T16:26:18Z")

</div>

Turns out that character I used to get the picture and test that it still worked was leftover from before the bug. He can "E"at batteries just fine but making a new character with a battery charger just says inedible like you were getting. Sorry for any confusion.

---

<div class="post-metadata">

### Author: ![GoLoT](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/golot/32/11385_2.png) [@GoLoT](https://discourse.cataclysmdda.org/u/GoLoT)
#### Post date: [July 24, 2021, 1:52pm UTC](https://discourse.cataclysmdda.org/t/battery-system-cbm-possible-bug/26722/8 "2021-07-24T13:52:23Z")

</div>

Quick update: The PR has been merged to the experimental branch. It should be fixed now.
