Tools that take magazines but have an initial_charge entry behave strangely #30754
Labels
<Bug>
This needs to be fixed
Items / Item Actions / Item Qualities
Items and how they work and interact
Spawn
Creatures, items, vehicles, locations appearing on map
Milestone
Describe the bug
Root cause of #30236 and #30185 .
Background
When I initially implemented the battery overhaul, I wanted the professions that started with cell phones to have them start fully charged, but didn't want to adjust eighty different professions to make that happen. (I would later do this in #30742). My hack solution was to give cell phones an initial charge of 150, as I figured you cannot craft them anyhow and any cases where I don't want them full, I would override.
Behavior
If a tool takes magazines, but also has an initial charge when crafted or spawned, those charges are essentially "stuck" inside the tool. In the case of the cell phone, this was the behavior:
Steps To Reproduce
Create a new tool that accepts battery magazines but also has an initial charge. Spawn that tool in and note the strangeness.
Expected behavior
Ideally, if a tool takes magazines but also specifies an initial charge, the game should be smart enough to only put the initial charge into the magazine when that item is spawned, leaving that item's
charges
field alone.Versions and configuration
N/A. This occurs on all configurations should a proper tool be present. That said, here is the version reported for #30236
OS: [Windows 10]
Game Version: [0.D-2546-g2ac90b3]
Graphics version: [Tiles]
Mods loaded: [Alternative map key, folding parts pack, classes and scenarios mod, more locations, urban development, fuju's more buildings,]
Additional context
This bug is very much not urgent. After #30742 is merged, no tools will remain in the base game or included mods that fit the criteria for this bug to occur.
The text was updated successfully, but these errors were encountered: