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

Vehicle parts retain damage fraction, don't stack, can't be repaired #23215

Closed
Nandorianen opened this issue Mar 15, 2018 · 3 comments · Fixed by #35444
Closed

Vehicle parts retain damage fraction, don't stack, can't be repaired #23215

Nandorianen opened this issue Mar 15, 2018 · 3 comments · Fixed by #35444
Assignees
Labels
<Bug> This needs to be fixed (S2 - Confirmed) Bug that's been confirmed to exist Vehicles Vehicles, parts, mechanics & interactions
Milestone

Comments

@Nandorianen
Copy link
Contributor

Game version:
0.C-7181
Operating system:
Win 7 64 bit.
Tiles or curses:
Tiles.
Mods active:
"dda",
"StatsThroughSkills",
"blazemod",
"deoxymod",
"ew_pack",
"no_npc_food",
"no_religious_Texts",
"no_reviving_zombies",
"novitamins"

Expected behavior

Vehicle parts (when not installed) should either be:
a) not damaged, stacking, or
b) damaged, show a damage indicator in inventory, and be repairable.

Actual behavior

Many vehicle parts have small enough damage to not be considered as having a proper damage level. They show up as white in inventory, cannot be repaired (only reinforced), but they do not stack with truly undamaged items. In save file they are shown having something like 0.334000, 0.583333, 0.666667, 0.668000, or 0.833333 damage. Parts that have the exact same amount of damage stack with each other. It looks like there is a piece of code somewhere that tries to damage parts by a proper amount (1, 2, 3) that then gets divided by some number that shouldn't be there.

Steps to reproduce the behavior

Find a naturally-generated vehicle and fully disassemble it. You should get multiple non-stacking white parts. Not sure if you can reproduce this by just driving a brand-new car through random bushes of love.

This was mentioned back in #20871, but for some reason it wasn't considered an issue at the time.

@Leland
Copy link
Contributor

Leland commented Mar 15, 2018

Save file?

@ZhilkinSerg ZhilkinSerg added <Bug> This needs to be fixed (S1 - Need confirmation) Report waiting on confirmation of reproducibility Vehicles Vehicles, parts, mechanics & interactions labels Mar 15, 2018
@Nandorianen
Copy link
Contributor Author

Made a fresh character from a fresh install of the 0.C-7214. Walked up to a first car that had three green wheels and one red wheel. Took off the three "undamaged" wheels and got two stacks of items: 2 with no damage, 1 with a fraction.
Also, if I remove the last wheel and repair it, it goes into a third stack with a different fraction of damage.
Here's a save.
save.zip
Here's a relevant part of it.
{ "typeid": "wheel", "invlet": 113, "damage": 0.340000 }, { "typeid": "wheel", "invlet": 115 }, { "typeid": "wheel", "invlet": 115 }

@Nandorianen
Copy link
Contributor Author

Nandorianen commented Mar 17, 2018

The problem seems to be broader than just vehicle parts generation.

Got to the point where I organize and repair my heaps of items. When I repair vehicle parts with proper damage values (1.0, 2.0, 3.0, etc), I get back parts with damage fractions as above that only stack with other parts damaged by exactly the same amount.

When I repair and refit clothing I get back items with 0 damage, but they won't stack at first.
{ "typeid": "helmet_liner", "invlet": 97, "damage": 0.000000, "item_tags": [ "FIT" ] }, { "typeid": "helmet_liner", "invlet": 104, "damage": 0.000000, "item_tags": [ "FIT" ] }, { "typeid": "helmet_liner", "invlet": 109, "damage": 0.000000, "item_tags": [ "FIT" ] }
They start stacking after I reload my game. This problem does not seem to occur when I refit items without repairing them.

Reinforcing items makes them stack again immediately.
{ "typeid": "helmet_liner", "invlet": 109, "damage": -1.000000, "item_tags": [ "FIT" ] }, { "typeid": "helmet_liner", "invlet": 109, "damage": -1.000000, "item_tags": [ "FIT" ] }, { "typeid": "helmet_liner", "invlet": 109, "damage": -1.000000, "item_tags": [ "FIT" ] }
This works both on clothing and on vehicle parts.

Checked a few backpacks that wouldn't stack after repair. Turned out two of them had their birthday recorded in a save file. They stacked after reloading.
{ "typeid": "backpack", "bday": 676313, "invlet": 113, "damage": 0.000000 }, { "typeid": "backpack", "bday": 676313, "invlet": 113, "damage": 0.000000 }, { "typeid": "backpack", "invlet": 104, "damage": 0.000000 }, { "typeid": "backpack", "invlet": 104, "damage": 0.000000 }

@Nandorianen Nandorianen changed the title Vehicle parts get slightly damaged, stop stacking, can't be repaired Vehicle parts retain damage fraction, don't stack, can't be repaired Mar 18, 2018
@kevingranade kevingranade added this to the 0.E milestone Sep 12, 2019
@ZhilkinSerg ZhilkinSerg added (S2 - Confirmed) Bug that's been confirmed to exist and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Sep 18, 2019
@mlangsdorf mlangsdorf self-assigned this Oct 5, 2019
mlangsdorf added a commit to mlangsdorf/Cataclysm-DDA that referenced this issue Nov 10, 2019
Fixes CleverRaven#23215

When removing vehicle parts, rationalize the damage to the damage
level * damage_scaling so that the removed parts will stack
nicely with each other.
mlangsdorf added a commit to mlangsdorf/Cataclysm-DDA that referenced this issue Nov 11, 2019
Fixes CleverRaven#23215

When removing vehicle parts, rationalize the damage to the damage
level * damage_scaling so that the removed parts will stack
nicely with each other.
kevingranade pushed a commit that referenced this issue Nov 12, 2019
Fixes #23215

When removing vehicle parts, rationalize the damage to the damage
level * damage_scaling so that the removed parts will stack
nicely with each other.
AMurkin pushed a commit to AMurkin/Cataclysm-DDA that referenced this issue Nov 13, 2019
Fixes CleverRaven#23215

When removing vehicle parts, rationalize the damage to the damage
level * damage_scaling so that the removed parts will stack
nicely with each other.
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 (S2 - Confirmed) Bug that's been confirmed to exist Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants