From 1edc6716b0b52608a74767446bbdac3aa41ca759 Mon Sep 17 00:00:00 2001 From: C09 <100433934+CI09@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:17:52 +0100 Subject: [PATCH] Clear endosymbiosis when entering multicellular (#5864) * Clear endosymbiosis when entering multicellular * Make new method for clearing all endosymbiosis targets --- src/general/EndosymbiosisData.cs | 9 +++++++++ src/microbe_stage/MicrobeStage.cs | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/general/EndosymbiosisData.cs b/src/general/EndosymbiosisData.cs index 2b948068d19..b67094d2948 100644 --- a/src/general/EndosymbiosisData.cs +++ b/src/general/EndosymbiosisData.cs @@ -113,6 +113,15 @@ public bool CancelEndosymbiosisTarget(int targetSpeciesId) return true; } + public bool CancelAllEndosymbiosisTargets() + { + if (StartedEndosymbiosis == null) + return false; + + StartedEndosymbiosis = null; + return true; + } + public InProgressEndosymbiosis MarkEndosymbiosisDone(InProgressEndosymbiosis endosymbiosisToComplete) { if (StartedEndosymbiosis == null) diff --git a/src/microbe_stage/MicrobeStage.cs b/src/microbe_stage/MicrobeStage.cs index 6771e16217a..688395558ac 100644 --- a/src/microbe_stage/MicrobeStage.cs +++ b/src/microbe_stage/MicrobeStage.cs @@ -586,6 +586,8 @@ public void MoveToMulticellular() throw new Exception("failed to keep the current scene root"); } + GameWorld.PlayerSpecies.Endosymbiosis.CancelAllEndosymbiosisTargets(); + // TODO: The multicellular stage needs to be able to track statistics and not break organelle unlocks GameWorld.UnlockProgress.UnlockAll = true;