Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools that take magazines but have an initial_charge entry behave strangely #30754

Closed
Inglonias opened this issue May 22, 2019 · 2 comments
Closed
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

Comments

@Inglonias
Copy link
Contributor

Inglonias commented May 22, 2019

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:

  • Cell phones could be activated even when not loaded with a battery magazine
  • Cell phones would remain in the Unload menu even when not loaded with a battery magazine. Attempts to unload it would fail.
  • Cell phones would provide players with their remaining charges when disassembled, essentially giving players free legacy batteries.

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.

@ifreund ifreund added <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 labels May 23, 2019
@kevingranade kevingranade added this to the 0.E milestone Sep 6, 2019
@I-am-Erk
Copy link
Member

@kevingranade What are your thoughts on closing this? I would argue it's an artifact of using JSON incorrectly at this point since it does not appear in the game.

@kevingranade
Copy link
Member

Yea this is historical and there's no reason to mess with it unless it recurrs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants