There’s already a github issue, thanks.
I thought this was more complicated than it was, but the answer turns out to be that the interaction of the jumper cable and the cable charger system is not super well thought out.
When you first activate a jumper cable, it records the global pos3 of the vehicle part you’re attaching it to. When you activate it again, it installs itself as a vehicle part on both vehicles. But if you’re using a cable charger system, you don’t do the second part, so the cable charger is just in item in your inventory, attached to a nominal vehicle at the initial global pos3. When it comes time to process the cable, if the vehicle has moved away from that initial global pos3, then the disconnect code happens normally.
What should happen is that when you activate a cable charger system, the jumper cable’s “state” var should be set to “cable_charger”. get_cable_target should take player *p as an argument and if the state is “cable_charger”, check if p is a passenger and if so, return the pos3 of p.
I was going to go hack at NPC AI but what the heck, this should be easy to fix.