private void SyncedSpells_OnItemRemoved(SpellInstance obj) { RunLater(() => { foreach (var effect in obj.Cast.Def.Effects) { obj.ParentEntity = this.ParentEntity; effect.Def.End(obj, true, obj.SuccesEnd); obj.ParentEntity = null; } ParentEntity.EndDebugEvent($"{((SpellDef)obj.Def).____GetDebugShortName()}:{obj.Id}"); }); }