]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix plant mutations carrying over to other plants and future rounds (#32257)
authordrakewill-CRL <46307022+drakewill-CRL@users.noreply.github.com>
Tue, 17 Sep 2024 19:45:42 +0000 (15:45 -0400)
committerGitHub <noreply@github.com>
Tue, 17 Sep 2024 19:45:42 +0000 (11:45 -0800)
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>
Content.Server/Botany/SeedPrototype.cs

index 7a3e08883ded766f0d14ce19035179be20c42c46..5608338f22e8d4e4b69821f5af6005cb457e8346 100644 (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;
     }