Skip to content

Fix CarryOverFreshness mangling other transition types - #91

Open
TealSeer wants to merge 1 commit into
anegostudios:masterfrom
TealSeer:carryover-fix
Open

Fix CarryOverFreshness mangling other transition types#91
TealSeer wants to merge 1 commit into
anegostudios:masterfrom
TealSeer:carryover-fix

Conversation

@TealSeer

@TealSeer TealSeer commented Aug 31, 2026

Copy link
Copy Markdown

Fixes anegostudios/VintageStory-Issues#3476 and fixes anegostudios/VintageStory-Issues#9374

The issue here was that CarryOverFreshness only operated on the Perish type of TransitionProperties, which made sense, but when it wrote to the itemstack attributes it would replace items that had multiple transition states with a transitionstate that just had the perish numbers, which then causes UpdateAndGetTransitionStatesNative to compensate by copying whatever numbers are there to fill the other states. This leads to e.g. raw waxed cheese's Ripen transition having all the numbers for its Perish transition i.e. non-zero freshHours. This in turn causes weirdness where the cheese counts down ~20 days (of fresh hours), then starts "ripening" and counts down another ~20 days (of the actual transition hours), entering the negatives in the process.

I would have liked to fix this without changing public method signatures, but it wasn't really possible. I just changed the method to take the entire TransitionProperties[] array and build out the new TreeAttributes as normal, with the existing handling behind a check for the Perish type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ripened Raw cheese (waxed) with negative day left to ripen can't be used Negative numbers for cheese ripening

1 participant