Fix plant mutations carrying over to other plants and future rounds (#32257)

Lists are a reference type, so each component should get a new one, not point at the previous one.

Co-authored-by: PraxisMapper <praxismapper@gmail.com>
This commit is contained in:
drakewill-CRL
2024-09-17 15:45:42 -04:00
committed by GitHub
parent 9afc786573
commit 337af483ca

View File

@@ -291,12 +291,13 @@ public partial class SeedData
CanScream = CanScream,
TurnIntoKudzu = TurnIntoKudzu,
SplatPrototype = SplatPrototype,
Mutations = Mutations,
Mutations = new List<RandomPlantMutation>(),
// Newly cloned seed is unique. No need to unnecessarily clone if repeatedly modified.
Unique = true,
};
newSeed.Mutations.AddRange(Mutations);
return newSeed;
}