CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.67k stars 4.18k forks source link

Can't attach power conversion mod to e-ink tablet PC #76717

Open dev-dsp opened 1 month ago

dev-dsp commented 1 month ago

Describe the bug

I'm trying to attach bionic pcm to my e-ink tablet, but receive the following:

You can't unload a <device name>!
You cancel unloading the tool.

Attach save file

Nairn-trimmed.tar.gz

Steps to reproduce

  1. 'a'ttach tool to a charged device

Expected behavior

Able to attach mods to tools

Screenshots

image

Versions and configuration

Additional context

No response

BaumgeistOne commented 1 month ago

Is there still charge left?

I had the same problem, but once I drained all the charge, I was able to install the mod.

dev-dsp commented 1 month ago

Yep, it's 86/86, but it shouldn't be a problem since by modding either the battery should be removed, or the connector replaced. In both options you don't need to drain the charge, hence I believe it's a bug.

BaumgeistOne commented 1 month ago

Of course it is a bug, I just wanted to mention a possibility of working around it. :)

Kantonine commented 1 month ago

I tried doing this yesterday, and I found out (same with smartphones too actually) that attaching a battery mod doesnt allow you to use batteries to reload it

GuardianDll commented 1 month ago

i suspect tool_mod require tool being empy, and having charges inside a tool makes it think it is not empty

Kantonine commented 1 month ago

i suspect tool_mod require tool being empy, and having charges inside a tool makes it think it is not empty

Do you mean when something is even partially charged? I turned on the tablet for the entire night while I was sleeping, so it could drain its entire battery, so that i can install the mod. so it showed up as being E-ink tablet +1. if i kept it charged at all, it wouldnt attach. I suspect it's because that installing a battery mod has the process of trying to unload the physical battery from the item. This works with items that don't have a internal battery, or any battery slots (Flashlights and Hotplates for example). Meanwhile, you can't unload the battery from E-ink Tablets or smartphones as it is integrated, and thus, you can't remove the previous battery connection. For the e-ink tablet, this shows up as having no acceptable form factors for batteries. Smartphones also don't have this, and asfaik, still need a ups connection to recharge (I haven't been able to test whether the actual capacity has changed afterwards)

GuardianDll commented 1 month ago

https://github.com/CleverRaven/Cataclysm-DDA/blob/5f6f5e06a32ce82eac22e3ccebac27f1d1640c0f/src/iuse.cpp#L5364-L5369 As i told, trying to install gunmod check is there any ammo inside tool, but because !p->unload( loc ) fails (because battery charges has NO_UNLOAD), it simply refuses to install one In theory one just need to add a code here, that checks if tool has NO_UNLOAD flag

chaoticidealism commented 1 month ago

This also prevents you from attaching a battery mod to your tool (the kind that lets you use replaceable batteries). Very annoying on my No Vehicles/Wayfarer run!