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

Address cloneable warnings in logs #695

Open
Chicken-Bones opened this issue Mar 1, 2024 · 1 comment
Open

Address cloneable warnings in logs #695

Chicken-Bones opened this issue Mar 1, 2024 · 1 comment
Labels
Enhancement New feature or request High Priority Issues that halt gameplay, cause softlocks, or corrupt data

Comments

@Chicken-Bones
Copy link

Issue Description

These warnings indicate potential issues or bugs, and can be silenced with a review. It's always good to keep your logs clean.

Note the recommended action is

For deep-cloning, add a custom Clone override and make proper copies of these fields. If shallow (memberwise) cloning is acceptable, mark the fields with [CloneByReference] or properties with [field: CloneByReference]

Item cloning happens when splitting a stack, so it's mostly a non-issue for non-stackable items, but that's not the only place it can ever happen. You don't want two items sharing a mutable field. Let me know if you'd like some help with any specific item in the list.

StarlightRiver.Content.Abilities.InfusionItem has reference fields (ability, <AbilityType>k__BackingField) that may not be safe to share between clones.
StarlightRiver.Content.Items.BaseTypes.SmartAccessory has reference fields (parents) that may not be safe to share between clones.
StarlightRiver.Content.Items.Breacher.Scrapshot has reference fields (hook) that may not be safe to share between clones.
StarlightRiver.Content.Items.BaseTypes.CursedAccessory has reference fields (Glow, parents) that may not be safe to share between clones.
StarlightRiver.Content.Items.Dungeon.StarlightPendant has reference fields (manaConsumed) that may not be safe to share between clones.
StarlightRiver.Core.Systems.CombatMountSystem.CombatMountItem has reference fields (mount) that may not be safe to share between clones.
StarlightRiver.Content.Items.Food.Meal has reference fields (<Ingredients>k__BackingField) that may not be safe to share between clones.
StarlightRiver.Content.Items.Forest.SlimePrinceHead has reference fields (prince) that may not be safe to share between clones.
StarlightRiver.Content.Items.Haunted.PoltergeistHead has reference fields (minions) that may not be safe to share between clones.
StarlightRiver.Content.Items.Jungle.Corpseflower has reference fields (maxTimeLefts, Glow, parents) that may not be safe to share between clones.
StarlightRiver.Content.Items.Magnet.Thunderbuss has reference fields (ball) that may not be safe to share between clones.
StarlightRiver.Content.Items.BaseTypes.MultiAmmoWeapon has reference fields (<ValidAmmos>k__BackingField, ammoItem) that may not be safe to share between clones.
StarlightRiver.Content.Items.Misc.MagmaGun has reference fields (proj) that may not be safe to share between clones.
StarlightRiver.Content.Items.Misc.SoilgunFiles.SoilgunGlobalItem has reference fields (ammoTooltip) that may not be safe to share between clones.
StarlightRiver.Content.Items.Misc.Sorcerwrench has reference fields (proj) that may not be safe to share between clones.
StarlightRiver.Core.InworldItem has reference fields (inWorldNPC) that may not be safe to share between clones.
StarlightRiver.Content.Items.Starwood.StarwoodItem has reference fields (EmpoweredTexture) that may not be safe to share between clones.
StarlightRiver.Core.Systems.KeywordSystem.KeywordScanner has reference fields (thisKeywords) that may not be safe to share between clones.
@github-actions github-actions bot added the New Needs tagged/assaigned label Mar 1, 2024
@ScalarVector1 ScalarVector1 added Enhancement New feature or request High Priority Issues that halt gameplay, cause softlocks, or corrupt data and removed New Needs tagged/assaigned labels Mar 10, 2024
@ScalarVector1
Copy link
Contributor

#697 Currently looking at this to address these. Please tell me if anything there looks incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request High Priority Issues that halt gameplay, cause softlocks, or corrupt data
Projects
None yet
Development

No branches or pull requests

2 participants