Skip to content

fix: Various cable charger CBM fixes#9789

Merged
chaosvolt merged 1 commit into
cataclysmbn:mainfrom
Kelenius:CableBlues
Jul 3, 2026
Merged

fix: Various cable charger CBM fixes#9789
chaosvolt merged 1 commit into
cataclysmbn:mainfrom
Kelenius:CableBlues

Conversation

@Kelenius

@Kelenius Kelenius commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Purpose of change (The Why)

Cable chargers, when active, can only take either their full power draw or nothing from whatever they're connected to. That means if you have a Leukocyte Breeder running (5 J/turn) and you're connected to your car with a cable charger mk2, it will draw 10 battery charges, which is 10kJ = 10000J every turn, while voiding 9995 of them. In the process of investigating it I also found some minor issues that I fixed.
(Yes, you can turn on fuel saving and auto start, but 1) you need to know to do that and it's not intuitive to have the power go into nothing and 2) it spams you with messages.)

Describe the solution (The How)

  • Not related to cable charger, but I renamed "sun light" to "sunlight" because fuel types are separated by spaces, so it was confusing to read. I don't know why it's spelled like that in the first place.
  • Cable charger wouldn't update available power immediately when turned on (it would just display "battery:").
  • Cable chargers now draw as much power as they need, anywhere from 1 kJ (1 battery charge) to their max draw.
  • If you had multiple UPSes and connected the cable to one of them, the game would draw from the first one you have, not the one you were actually connected to (filter wasn't respected).
  • Fixes Enabled bio ups prevents cable charger from charging bionic power from ups item #9117 (the game always prioritised drawing from bionic power - now it only does that if the filter isn't set).

Describe alternatives you've considered

  • I hate how Character::find_remote_fuel works and would like to change it, but it's consistent with other fuelled bionics.
  • Additionally, cable charger now won't charge you to full, e.g. if you have 199.5/200 kJ, it won't charge you to 200. It's not possible to draw half of a charge from batteries, so the options here are 1) don't charge to full 2) charge the last kJ for free 3) charge it for 1 battery charge, which is the current behaviour that causes problems.
  • I'm not a huge fan of the filter( null_item_reference() ) check, but the only other option I could think of is to add a new parameter to use_charges, which I really don't want to do just for this incredibly specific interaction.

There are some issues that I found and didn't fix:

  • Cable charger wouldn't charge on the first turn after it was activated. It's something that seems to affect all bionics that activate every X turns, and I quickly realised it's beyond my ability to test.
  • Bionics UI doesn't always show an accurate number of available power when cable charger that's connected to an UPS. Minor issue that isn't easy to fix.
  • Bionics UI doesn't properly update number of charges available when connected to something and the amount of power in that something changes externally (e.g. a car with power generation/use). Also minor and not easy to fix.

Testing

Did some testing by connecting to vehicle/solar backpack/UPS to make sure it works. Also that regular UPS charging works.

Checklist

Mandatory

Build Artifacts

PR build for commit 376f5f7 (Various cable CBM fixes) on 2026-07-03 18:14:04

@github-actions github-actions Bot added src changes related to source code. JSON related to game datas in JSON format. labels Jul 3, 2026
@chaosvolt chaosvolt merged commit d1cde4d into cataclysmbn:main Jul 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JSON related to game datas in JSON format. src changes related to source code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enabled bio ups prevents cable charger from charging bionic power from ups item

2 participants