CandyNim
Tiller
Okay for this one I'm not entirely sure if it's a bug or not; there's code that suggests it might be, and code that suggests it might not be.
Bug: Fruit on a tree from before a tree ages to the next quality remains at the old quality even after the tree ages to the next quality.
Code Analysis: In
This explicitly passes in the fruitQuality, which is calculated earlier with the current age of the tree. However, because the fruit is an
Suggested Fix: If this isn't a bug, just delete the
If this isn't a bug, setting
Version Analysis: In 1.5, the fruit aged with the tree. It looks like this changed behavior happened during the 1.6 change (2022-03-07 build made the fruitontree be Items rather than just grabbing the string id, and the 2023-01-27 build make the Item have quality).
Attached is a save file with an apple tree that currently has a normal quality fruit attached, and if you sleep you get both a normal and a silver quality fruit from the tree.
Bug: Fruit on a tree from before a tree ages to the next quality remains at the old quality even after the tree ages to the next quality.
Code Analysis: In
FruitTree.shake, the game has the following section of code
C#:
Item item = this.fruit[j];
this.fruit[j] = null;
d = new Debris(item, new Vector2(tileLocation.X * 64f + 32f, (tileLocation.Y - 3f) * 64f + 32f) + offset, playerPixel)
{
itemQuality = fruitQuality
};
Item, the fruit comes with a quality already attached (given by FruitTree.TryCreateFruit) and from how Debris work the quality of an Item object overwrites any manually passed in quality. Suggested Fix: If this isn't a bug, just delete the
{itemQuality = fruitQuality} passing in because it does nothing. I'm also unsure why Coal gets given quality, because while it gives a string id and thus the quality variable would be considered, the quality is always 0 when a tree is struck by lightning so it's always going to pass in 0.If this isn't a bug, setting
item.Quality.Value = fruitQuality instead would fix it. Honestly both seem fine to me I just ran into it and saw the fact that the code intentions seem split.Version Analysis: In 1.5, the fruit aged with the tree. It looks like this changed behavior happened during the 1.6 change (2022-03-07 build made the fruitontree be Items rather than just grabbing the string id, and the 2023-01-27 build make the Item have quality).
Attached is a save file with an apple tree that currently has a normal quality fruit attached, and if you sleep you get both a normal and a silver quality fruit from the tree.
Attachments
-
210.2 KB Views: 20