Beispiel #1
0
            // Methods
            public override bool Run() // Run
            {
                Slot[] routingSlots = this.Target.GetRoutingSlots();
                bool   flag         = false;
                Route  route        = this.Actor.CreateRoute();

                if (route.PlanToSlot(this.Target, routingSlots).Succeeded())
                {
                    flag = this.Actor.DoRoute(route);
                }
                else if (this.Actor.RouteToObjectRadius(this.Target, 1f))
                {
                    flag = true;
                }
                //SpeedTrap.Sleep(10);
                bool a;

                // Pet Only Crazy CLIP Fixed No CLIP
                if (!NFinalizeDeath.IsActiveHouseholdWithActiveActorPro(Actor.Household, NFinalizeDeath.ActiveActor) && Actor.SimDescription.IsPet)
                {
                    //if (NiecHelperSituation.___bOpenDGSIsInstalled_)
                    //  a=  Actor.Kill(SimDescription.DeathType.PetOldAgeGood);
                    //else
                    //  a=  KillPro.FastKill(Actor, SimDescription.DeathType.PetOldAgeGood, null, true, false);
                    ////KillSimNiecX.MineKill(Actor, SimDescription.DeathType.PetOldAgeGood, true);
                    //return a;

                    if (NiecHelperSituation.___bOpenDGSIsInstalled_)
                    {
                        return(true);
                    }
                    return(KillPro.FastKill(Actor, SimDescription.DeathType.PetOldAgeGood, null, true, false));
                }
                else if (Actor.SimDescription.IsPet)
                {
                    NFinalizeDeath.Sim_MaxMood(Actor);
                    return(true);
                }
                base.StandardEntry();
                base.BeginCommodityUpdates();
                base.AcquireStateMachine("JellyBean");
                base.SetActor("x", this.Actor);
                if (Actor.SimDescription.Age == CASAgeGenderFlags.Toddler)
                {
                    mCurrentStateMachine.SetParameter(499670524u, typeof(Sims3.SimIFace.Enums.Age), (ulong)Sims3.SimIFace.Enums.Age.child);
                }
                base.SetActor("magicjellybeanbush", this.Target);
                base.EnterState("x", "JellyBeanEnter");
                if (!NFinalizeDeath.SimIsGRReaper(Actor.SimDescription) && !NiecHelperSituation.___bOpenDGSIsInstalled_ && !NFinalizeDeath.IsActiveHouseholdWithActiveActorPro(Actor.Household, NFinalizeDeath.ActiveActor))
                {
                    base.AnimateSim("Poisoned");
                    //if (!Actor.CanBeKilled()) // My Mod is CanBeKilled Not Modifed The Sims 3 is File Dll Gameplay
                    //{
                    //    KillSimNiecX.MineKill(Actor, SimDescription.DeathType.Starve);
                    //    SpeedTrap.Sleep(10);
                    //    //return false;
                    //}
                    //Actor.Kill(SimDescription.DeathType.Starve);


                    //if (NiecHelperSituation.___bOpenDGSIsInstalled_)
                    //   a = Actor.Kill(SimDescription.DeathType.Starve, null, false);
                    //else
                    a = KillPro.FastKill(Actor, SimDescription.DeathType.Starve, null, false, false);



                    //return false;
                }
                else
                {
                    //float @float = RandomUtil.GetFloat(1f);
                    //if (//@float < 100 &&
                    //    NFinalizeDeath.IsActiveHouseholdWithActiveActorPro(Actor.Household, NFinalizeDeath.ActiveActor)) // this.Actor.IsInActiveHousehold)
                    //{
                    //    base.AnimateSim("NormalExit");
                    //    NFinalizeDeath.Sim_MaxMood(Actor);
                    //    return true;
                    //}
                    //else if (@float < JellyBeanBush.kChanceToCatchOnFire + JellyBeanBush.kChanceToBeElectrocuted + JellyBeanBush.kChanceToGetTooSpicy )
                    //{
                    //	base.AnimateSim("NormalExit");
                    //	this.Actor.BuffManager.AddElement(BuffNames.TooSpicy, Origin.FromMagicJellyBean);
                    //}
                    //else if (@float < JellyBeanBush.kChanceToCatchOnFire + JellyBeanBush.kChanceToBeElectrocuted + JellyBeanBush.kChanceToGetTooSpicy + JellyBeanBush.kChanceToGetPositiveBuff)
                    //{
                    //	base.AnimateSim("NormalExit");
                    //	this.Target.ApplyRandomBuff(this.Actor, JellyBeanBush.JellyBeanBuffType.NormalPositive);
                    //	VisualEffect.FireOneShotEffect("ep7BuffJellyBeanPos_main", this.Actor, Sim.FXJoints.Pelvis, VisualEffect.TransitionType.SoftTransition);
                    //	if (RandomUtil.CoinFlip())
                    //	{
                    //		this.Actor.PlayReaction(ReactionTypes.Excited, ReactionSpeed.NowOrLater);
                    //	}
                    //	else
                    //	{
                    //		this.Actor.PlayReaction(ReactionTypes.Cheer, ReactionSpeed.NowOrLater);
                    //	}
                    //}
                    //else if (@float < JellyBeanBush.kChanceToCatchOnFire + JellyBeanBush.kChanceToBeElectrocuted + JellyBeanBush.kChanceToGetTooSpicy + JellyBeanBush.kChanceToGetPositiveBuff + JellyBeanBush.kChanceToGetNegitiveBuff)
                    //{
                    //	base.AnimateSim("NormalExit");
                    //	this.Target.ApplyRandomBuff(this.Actor, JellyBeanBush.JellyBeanBuffType.NormalNegative);
                    //	VisualEffect.FireOneShotEffect("ep7BuffJellyBeanNeg_main", this.Actor, Sim.FXJoints.Pelvis, VisualEffect.TransitionType.SoftTransition);
                    //	if (RandomUtil.CoinFlip())
                    //	{
                    //		this.Actor.PlayReaction(ReactionTypes.Shocked, ReactionSpeed.NowOrLater);
                    //	}
                    //	else
                    //	{
                    //		this.Actor.PlayReaction(ReactionTypes.HeadPain, ReactionSpeed.NowOrLater);
                    //	}
                    //}
                    //else if (@float < JellyBeanBush.kChanceToCatchOnFire + JellyBeanBush.kChanceToBeElectrocuted + JellyBeanBush.kChanceToGetTooSpicy + JellyBeanBush.kChanceToGetPositiveBuff + JellyBeanBush.kChanceToGetNegitiveBuff + JellyBeanBush.kChanceToGetPosTransBuff)
                    //{
                    //	base.AnimateSim("NormalExit");
                    //	OccultImaginaryFriend occultImaginaryFriend;
                    //
                    //	if (!this.Actor.BuffManager.HasTransformBuff() && !this.Actor.IsWearingSpecialOutfit(UniversityMascot.MascotOutfitKey) && !OccultImaginaryFriend.TryGetOccultFromSim(this.Actor, out occultImaginaryFriend) && !this.Actor.IsSimBot)
                    //	{
                    //		this.Target.ApplyRandomBuff(this.Actor, JellyBeanBush.JellyBeanBuffType.TransPositive);
                    //		if (RandomUtil.CoinFlip())
                    //		{
                    //			this.Actor.PlayReaction(ReactionTypes.Excited, ReactionSpeed.AfterInteraction);
                    //		}
                    //		else
                    //		{
                    //			this.Actor.PlayReaction(ReactionTypes.Cheer, ReactionSpeed.AfterInteraction);
                    //		}
                    //	}
                    //}
                    //else if (@float < JellyBeanBush.kChanceToCatchOnFire + JellyBeanBush.kChanceToBeElectrocuted + JellyBeanBush.kChanceToGetTooSpicy + JellyBeanBush.kChanceToGetPositiveBuff + JellyBeanBush.kChanceToGetNegitiveBuff + JellyBeanBush.kChanceToGetPosTransBuff + JellyBeanBush.kChanceToGetNegTransBuff)
                    //{
                    //	base.AnimateSim("NormalExit");
                    //	OccultImaginaryFriend occultImaginaryFriend2;
                    //	if (!this.Actor.BuffManager.HasTransformBuff() && !this.Actor.IsWearingSpecialOutfit(UniversityMascot.MascotOutfitKey) && !OccultImaginaryFriend.TryGetOccultFromSim(this.Actor, out occultImaginaryFriend2))
                    //	{
                    //		this.Target.ApplyRandomBuff(this.Actor, JellyBeanBush.JellyBeanBuffType.TransNegative);
                    //		if (RandomUtil.CoinFlip())
                    //		{
                    //			this.Actor.PlayReaction(ReactionTypes.Shocked, ReactionSpeed.AfterInteraction);
                    //		}
                    //		else
                    //		{
                    //			this.Actor.PlayReaction(ReactionTypes.HeadPain, ReactionSpeed.AfterInteraction);
                    //		}
                    //	}
                    //}
                    //else
                    //{
                    //	base.AnimateSim("NormalExit");
                    //}
                    base.AnimateSim("NormalExit");
                    if (NFinalizeDeath.IsActiveHouseholdWithActiveActorPro(Actor.Household, NFinalizeDeath.ActiveActor))
                    {
                        NFinalizeDeath.Sim_MaxMood(Actor);
                    }
                    base.EndCommodityUpdates(true);
                    base.StandardExit();
                    return(true);
                }
                base.EndCommodityUpdates(true);
                base.StandardExit();
                EventTracker.SendEvent(EventTypeId.kEatMagicJellyBean, this.Actor);
                return(a);
            }
Beispiel #2
0
        internal static void r_internal(Sim Actor)
        {
            NiecHelperSituationPosture nhsp = null;

            if (Actor != null && !NFinalizeDeath.GameObjectIsValid(Actor.ObjectId.mValue)) //NFinalizeDeath.GetObject_internalFastO(Actor.ObjectId.mValue) == null)
            {
                nhsp           = (Actor.Posture as NiecHelperSituationPosture);
                Actor.mPosture = null;
                if (nhsp != null)
                {
                    nhsp._Actor = null;
                    nhsp.PBack  = null;
                }
            }

            if (Actor == null || Actor.ObjectId.mValue != ScriptCore.Simulator.Simulator_GetCurrentTaskImpl() || !Simulator.CheckYieldingContext(false))
            {
                return;
            }

            var     sim          = Actor;
            bool    bNeedMaxMood = false;
            Posture pBackUp      = null;

            if (sim.Posture is NiecHelperSituationPosture)
            {
                nhsp         = (sim.Posture as NiecHelperSituationPosture);
                pBackUp      = nhsp.PBack;
                bNeedMaxMood = nhsp.NeedMaxMood;
                nhsp._Actor  = null;
                if (sim.Standing is NiecHelperSituationPosture)
                {
                    sim.Standing = null;
                    sim.mPosture = null;
                    if (sim.mSimDescription != null)
                    {
                        if (sim.mSimDescription.IsPet)
                        {
                            PetStandingPosture dr = new PetStandingPosture(sim);
                            sim.PetSittingOnGround = new PetSittingOnGroundPosture(sim);
                            sim.Standing           = dr;
                            sim.Posture            = null;
                        }
                        else
                        {
                            Sim.StandingPosture dre = new Sim.StandingPosture(sim);
                            sim.Standing = dre;
                            sim.Posture  = null;
                        }
                    }
                }
                else if (nhsp.PBack != null)
                {
                    sim.mPosture = nhsp.PBack;//sim.Standing;
                }
                else
                {
                    sim.mPosture = sim.Standing;
                }

                nhsp.PBack = null;
            }

            if (Disallowr_internal || (NiecHelperSituation.ExAA && sim == (NPlumbBob.DoneInitClass ? NFinalizeDeath.GetSafeSelectActor() : PlumbBob.SelectedActor)))
            {
                return;
            }

            if (!TestDEBUGMyMod && !SCOSR.IsScriptCore2020() && !IsOpenDGSInstalled &&
                NFinalizeDeath.baCheckACoreThrowNRaasErrorTrap &&
                NiecHelperSituation.__acorewIsnstalled__ &&
                NFinalizeDeath.IsSTAwesomeMod02Fast <Sim>()
                )
            {
                if (nhsp != null)
                {
                    NiecTask.Perform(delegate {
                        Simulator.Sleep(450);
                        var p = sim.mPosture;
                        if (p is NiecHelperSituationPosture)
                        {
                            return;
                        }

                        //NFinalizeDeath.Assert(nhsp != null, "r_internal(): nhsp failed!");

                        if (p != null && p == p.PreviousPosture)
                        {
                            p.PreviousPosture = null;
                        }

                        sim.mPosture = p = nhsp;
                        nhsp.PBack   = pBackUp;
                        nhsp._Actor  = sim;

                        if (p != null && p == p.PreviousPosture)
                        {
                            p.PreviousPosture = null;
                        }
                    });
                }

                NFinalizeDeath.AntiSpy_ThrowDefault();
            }

            var lookm = Actor.LookAtManager;

            if (lookm != null)
            {
                lookm.DisableLookAts();
            }


            lookm   = null; // i know Saving TaskContext Failed. From OnSavingGame()
            nhsp    = null; //
            pBackUp = null; //


            //using(SafeSimUpdate.Run(sim)) {
            while (true)
            {
                NFinalizeDeath.CheckYieldingContext();


                if (NiecHelperSituation.__acorewIsnstalled__ &&
                    !NiecHelperSituation.___bOpenDGSIsInstalled_)
                {
                    var iV = ScriptCore.Queries.Query_CountObjects(typeof(Sim));
                    if (iV >= 2)
                    {
                        NiecRunCommand.native_testcpu_debug(null, null);
                    }
                    else if (iV == 1)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            NiecRunCommand.native_testcpu_debug(null, null);
                        }
                    }
                }

                if (!IsOpenDGSInstalled && NFinalizeDeath.GetCurrentExecuteType() == ScriptExecuteType.Task)
                {
                    Simulator.Sleep(20);
                }
                else
                {
                    Simulator.Sleep(IsOpenDGSInstalled ? 15u:0u);
                }

                if (NiecHelperSituation.__acorewIsnstalled__ &&
                    !NiecHelperSituation.___bOpenDGSIsInstalled_)
                {
                    var iV = ScriptCore.Queries.Query_CountObjects(typeof(Sim));
                    if (iV >= 2)
                    {
                        NiecRunCommand.native_testcpu_debug(null, null);
                    }
                    else if (iV == 1)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            NiecRunCommand.native_testcpu_debug(null, null);
                        }
                    }
                }

                if (!NFinalizeDeath.SimIsNiecHelperSituation(sim))
                {
                    continue;
                }
                if (Simulator.GetProxy(sim.ObjectId) == null)
                {
                    break;
                }
                if (Disallowr_internal || (NiecHelperSituation.ExAA && sim == (NPlumbBob.DoneInitClass ? NFinalizeDeath.GetSafeSelectActor() : PlumbBob.SelectedActor)))
                {
                    break;
                }

                var simIQ = sim.InteractionQueue;

                try
                {
                    if (IsOpenDGSInstalled)
                    {
                        if (sim.SimDescription == null)
                        {
                            break;
                        }
                        if (simIQ == null)
                        {
                            break;
                        }
                    }
                    else
                    {
                        if (sim.SimDescription == null)
                        {
                            sim.mSimDescription = Create.NiecNullSimDescription(true, false, true);
                        }

                        if (NFinalizeDeath.SimIsGRReaper(sim.SimDescription))
                        {
                            NiecHelperSituation.ExistsOrCreateAndAddToSituationList(sim);
                        }

                        if (simIQ == null)
                        {
                            sim.mInteractionQueue = simIQ = new Sims3.Gameplay.ActorSystems.InteractionQueue(sim);
                        }
                        else
                        {
                            if (simIQ.mInteractionList == null)
                            {
                                simIQ.mInteractionList = new List <InteractionInstance>();
                            }
                            else
                            {
                                while (simIQ.mInteractionList != null && niec_std.list_remove(simIQ.mInteractionList, null)) //simIQ.mInteractionList.Remove(null))
                                {
                                    Simulator.Sleep(0);
                                }
                            }
                        }
                    }
                }
                catch (NMAntiSpyException)
                { NFinalizeDeath.SafeForceTerminateRuntime(); }
                catch (StackOverflowException)
                { sim.mPosture = null; throw; }
                catch (ResetException)
                { throw; }
                catch
                {
                    NFinalizeDeath.CheckYieldingContext();

                    if (IsOpenDGSInstalled)
                    {
                        throw;
                    }
                    else
                    {
                        for (int i = 0; i < 45; i++)
                        {
                            Simulator.Sleep(0);
                        }
                        continue;
                    }
                }

                if (bNeedMaxMood)
                {
                    try
                    {
                        NFinalizeDeath.Sim_MaxMood(sim);
                    }
                    catch (NMAntiSpyException)
                    { NFinalizeDeath.SafeForceTerminateRuntime(); }
                    catch (StackOverflowException)
                    { if (!IsOpenDGSInstalled)
                      {
                          NFinalizeDeath.ThrowResetException(null);
                      }
                      throw; }
                    catch (ResetException)
                    { throw; }
                    catch
                    {
                        NFinalizeDeath.CheckYieldingContext();

                        if (IsOpenDGSInstalled)
                        {
                            throw;
                        }
                        else
                        {
                            for (int i = 0; i < 45; i++)
                            {
                                Simulator.Sleep(0);
                            }
                            continue;
                        }
                    }
                }
                try
                {
                    if (!IsOpenDGSInstalled && sim.mAutonomy != null)
                    {
                        //var sg = sim.mAutonomy;
                        try
                        {
                            AutonomyManager.Add(sim.mAutonomy);
                        }
                        catch (NMAntiSpyException)
                        { NFinalizeDeath.SafeForceTerminateRuntime(); }
                        catch (StackOverflowException)
                        { if (!IsOpenDGSInstalled)
                          {
                              NFinalizeDeath.ThrowResetException(null);
                          }
                          throw; }
                        catch (ResetException)
                        { throw; }
                        catch { }
                    }
                    var simIQList = simIQ.mInteractionList;
                    if (simIQList == null || simIQList.Count == 0)
                    {
                        continue;
                    }

                    var simIQListArray = simIQList.ToArray();
                    for (int i = 0; i < simIQListArray.Length; i++)
                    {
                        InteractionInstance inCurrentInteraction = simIQListArray[i];
                        if (inCurrentInteraction == null || inCurrentInteraction.InteractionDefinition == null)
                        {
                            while (simIQList != null && niec_std.list_remove(simIQList, null))//simIQList.Remove(null))
                            {
                                Simulator.Sleep(0);
                                simIQList = simIQ.mInteractionList;
                            }

                            if (simIQList == null)
                            {
                                break;
                            }

                            continue;
                        }

                        if (IsOpenDGSInstalled)
                        {
                            if (simIQList.IndexOf(inCurrentInteraction) != 0)
                            {
                                break;
                            }
                        }
                        else if (i != 0)
                        {
                            break;
                        }

                        if (simIQList == null)
                        {
                            break;
                        }

                        if (!NFinalizeDeath.InteractionIsNiecHelperSituationPosture_internal(sim, inCurrentInteraction))
                        {
                            //simIQList.Remove(inCurrentInteraction);
                            niec_std.list_remove(simIQList, inCurrentInteraction);
                            if (IsOpenDGSInstalled)
                            {
                                try
                                {
                                    inCurrentInteraction.CallCallbackOnFailure(sim);
                                    inCurrentInteraction.Cleanup();
                                }
                                catch (NMAntiSpyException)
                                { NFinalizeDeath.SafeForceTerminateRuntime(); }
                                catch (StackOverflowException)
                                { sim.mPosture = null; throw; }
                                catch (ResetException)
                                { throw; }
                                catch (Exception)
                                {
                                    NFinalizeDeath.CheckYieldingContext();
                                    if (IsOpenDGSInstalled)
                                    {
                                        throw;
                                    }
                                }
                            }
                            else
                            {
                                if (inCurrentInteraction.Target is Sim)
                                {
                                    inCurrentInteraction.mInstanceActor = inCurrentInteraction.Target;
                                }
                            }

                            if (sim.IsSelectable)
                            {
                                simIQ.FireQueueChanged();
                            }

                            break;
                        }

                        if (!Bim.TestInteractionEx(inCurrentInteraction) || (IsOpenDGSInstalled && !inCurrentInteraction.IsTargetValid()))
                        {
                            // simIQList.Remove(inCurrentInteraction);
                            niec_std.list_remove(simIQList, inCurrentInteraction);
                            try
                            {
                                inCurrentInteraction.CallCallbackOnFailure(sim);
                                inCurrentInteraction.Cleanup();
                            }
                            catch (NMAntiSpyException)
                            { NFinalizeDeath.SafeForceTerminateRuntime(); }
                            catch (StackOverflowException)
                            { sim.mPosture = null; throw; }
                            catch (ResetException)
                            { throw; }
                            catch (Exception)
                            {
                                NFinalizeDeath.CheckYieldingContext();
                                if (IsOpenDGSInstalled)
                                {
                                    throw;
                                }
                            }

                            //if (IsOpenDGSInstalled)
                            //    simIQ.DeQueue(false);

                            if (sim.IsSelectable)
                            {
                                simIQ.FireQueueChanged();
                            }

                            continue;
                        }

                        simIQ.mIsHeadInteractionLocked = true;

                        var runningInList = simIQ.mRunningInteractions;
                        if (runningInList != null)
                        {
                            runningInList.Push(inCurrentInteraction);
                        }

                        try
                        {
                            inCurrentInteraction.CallCallbackOnStart(sim);
                        }
                        catch (NMAntiSpyException)
                        { NFinalizeDeath.SafeForceTerminateRuntime(); }
                        catch (StackOverflowException)
                        { sim.mPosture = null; throw; }
                        catch (ResetException)
                        { throw; }
                        catch
                        {
                            NFinalizeDeath.CheckYieldingContext();
                            if (IsOpenDGSInstalled)
                            {
                                throw;
                            }
                        }


                        simIQ.mIsHeadInteractionActive = true;

                        bool okI = false;

                        try
                        {
                            okI = NFinalizeDeath._RunInteractionWithoutCleanUp(inCurrentInteraction);
                            if (okI)
                            {
                                inCurrentInteraction.CallCallbackOnCompletion(sim);
                            }
                            else
                            {
                                inCurrentInteraction.CallCallbackOnFailure(sim);
                            }
                        }
                        catch (NMAntiSpyException)
                        { NFinalizeDeath.SafeForceTerminateRuntime(); }
                        catch (StackOverflowException)
                        {
                            if (!IsOpenDGSInstalled)
                            {
                                try
                                {
                                    NiecTask.Perform(inCurrentInteraction.Cleanup);
                                }
                                catch (StackOverflowException)
                                {}

                                NFinalizeDeath.ThrowResetException(null);
                            }
                            throw;
                        }
                        catch (ResetException)
                        { throw; }
                        catch
                        {
                            NFinalizeDeath.CheckYieldingContext();
                            if (IsOpenDGSInstalled)
                            {
                                throw;
                            }
                        }


                        if (IsOpenDGSInstalled && Simulator.CheckYieldingContext(false))
                        {
                            simIQ.PutDownCarriedObjects(inCurrentInteraction);
                        }

                        simIQ = sim.InteractionQueue;
                        if (simIQ == null)
                        {
                            inCurrentInteraction.Cleanup();
                            break;
                        }

                        NFinalizeDeath.CheckYieldingContext();

                        if (IsOpenDGSInstalled)
                        {
                            simIQ.PutDownCarriedObjects(inCurrentInteraction);
                        }

                        simIQ.mIsHeadInteractionActive = false;
                        simIQ.mIsHeadInteractionLocked = false;

                        //if (IsOpenDGSInstalled)
                        //    simIQ.DeQueue(okI);

                        if (runningInList != null && runningInList.Count > 0)
                        {
                            runningInList.Pop();
                        }

                        simIQList = simIQ.mInteractionList;
                        if (simIQList == null)
                        {
                            inCurrentInteraction.Cleanup();
                            break;
                        }

                        NFinalizeDeath.CheckYieldingContext();

                        //simIQList.Remove(inCurrentInteraction);
                        niec_std.list_remove(simIQList, inCurrentInteraction);
                        inCurrentInteraction.Cleanup();

                        NFinalizeDeath.CheckYieldingContext();

                        while (simIQList != null && niec_std.list_remove(simIQList, null))
                        {
                            Simulator.Sleep(0);
                            simIQList = simIQ.mInteractionList;
                        }

                        if (simIQList == null)
                        {
                            break;
                        }

                        if (sim.IsSelectable)
                        {
                            simIQ.FireQueueChanged();
                        }
                    }
                }
                catch (NMAntiSpyException)
                { NFinalizeDeath.SafeForceTerminateRuntime(); }
                catch (StackOverflowException)
                { sim.mPosture = null; throw; }
                catch (ResetException)
                { throw; }
                catch
                {
                    NFinalizeDeath.CheckYieldingContext();

                    if (IsOpenDGSInstalled)
                    {
                        throw;
                    }
                    else
                    {
                        for (int i = 0; i < 45; i++)
                        {
                            Simulator.Sleep(0);
                        }
                        continue;
                    }
                }
            }//}
             //NFinalizeDeath.M();
        }