From ea1de138b27cc0a2660ba0299af59341a298747f Mon Sep 17 00:00:00 2001 From: kaboissonneault Date: Wed, 17 Jan 2024 21:07:28 -0500 Subject: [PATCH] Copy EntityEffectManager's instancedBundles for MagicRound() iteration, to avoid issues with effects that add new bundles --- Assets/Scripts/Game/MagicAndEffects/EntityEffectManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Game/MagicAndEffects/EntityEffectManager.cs b/Assets/Scripts/Game/MagicAndEffects/EntityEffectManager.cs index 6208ea0b4e..9ce90f9bd7 100644 --- a/Assets/Scripts/Game/MagicAndEffects/EntityEffectManager.cs +++ b/Assets/Scripts/Game/MagicAndEffects/EntityEffectManager.cs @@ -1713,7 +1713,8 @@ void DoMagicRound() // Run all bundles activeMagicItemsInRound.Clear(); uint currentTime = DaggerfallUnity.Instance.WorldTime.DaggerfallDateTime.ToClassicDaggerfallTime(); - foreach (LiveEffectBundle bundle in instancedBundles) + var currentInstancedBundles = new List(instancedBundles); // use a copy, as ending an effect can add new bundles (ex: wereworlf infection -> werewolf effect) + foreach (LiveEffectBundle bundle in currentInstancedBundles) { // Run effects for this bundle bool hasRemainingEffectRounds = false;