Exemple #1
0
        private static void OnSavingGame(IScriptObjectGroup group)
        {
            var p = Sims3.NiecModList.Persistable.ListCollon.NullSimSimDescription;

            if (p != null)
            {
                if (p.mSim != null)
                {
                    try
                    {
                        Bim.bSDestroy(p.mSim);
                    }
                    catch (Exception) { }
                }

                if (NiecHelperSituation.__acorewIsnstalled__)
                {
                    foreach (var item in Sims3.NiecModList.Persistable.ListCollon.SafeObjectGC_TempBim)
                    {
                        var itemSim = item as Sim;
                        if (itemSim == null)
                        {
                            continue;
                        }
                        itemSim.mSimDescription = p;
                    }
                }

                if (!NFinalizeDeath.IsNullOrEmpty(p.mFirstName) || (p.Household == Household.sNpcHousehold || p.Household == Household.sPetHousehold || p.Household == Household.sAlienHousehold))
                {
                    NFinalizeDeath.Household_Remove(p, true);
                    if (!NFinalizeDeath.IsNullOrEmpty(p.mFirstName) || p.IsValid || p.IsValidDescription)
                    {
                        NFinalizeDeath.RemoveAllSimNiecNullForGrave(true);
                        SimDescCleanseTask.SafeCallSimDescCleanseO1(p);
                    }
                }
                else
                {
                    p.mSim = null;
                }
            }
        }
Exemple #2
0
        public static void InitClass()
        {
            if (CheckLoop == -1)
            {
                //if (Sims3.NiecModList.Persistable.ListCollon.NullSimSimDescription == null)
                //    Sims3.NiecModList.Persistable.ListCollon.NullSimSimDescription = new SimDescription();

                LoadSaveManager.ObjectGroupSaving += OnSavingGame;

                NiecTask.Perform(() =>
                {
                    while (true)
                    {
                        Simulator.Sleep(0);
                        CheckLoop = 0;
                    }
                });

                //NiecTask.Perform(() =>
                //{
                //    if (NULLSIMDESC as SimDescription == null)
                //        NULLSIMDESC = new SimDescription();
                //
                //    SimDescCleanseTask.SafeCallSimDescCleanse((SimDescription)NULLSIMDESC);
                //
                //    while (true)
                //    {
                //        Simulator.Sleep(0);
                //        for (int i = 0; i < 1350; i++)
                //        {
                //            Simulator.Sleep(0);
                //        }
                //
                //        var p = NULLSIMDESC as SimDescription;
                //        if (p != null)
                //        {
                //            SimDescCleanseTask.SafeCallSimDescCleanse(p);
                //        }
                //    }
                //});

                NiecTask.Perform(() =>
                {
                    while (Helpers.Create.NiecNullSimDescription(true, false, true) == null)
                    {
                        Simulator.Sleep(0);
                    }

                    if (SimDescription.sLoadedSimDescriptions != null)
                    {
                        SimDescription.sLoadedSimDescriptions.Remove(Sims3.NiecModList.Persistable.ListCollon.NullSimSimDescription);
                    }

                    while (true)
                    {
                        Simulator.Sleep(0);
                        for (int i = 0; i < 350; i++)
                        {
                            Simulator.Sleep(0);
                        }

                        var p = Sims3.NiecModList.Persistable.ListCollon.NullSimSimDescription;
                        if (p != null && (p.Household == Household.sNpcHousehold || p.Household == Household.sPetHousehold || p.Household == Household.sAlienHousehold))
                        {
                            NFinalizeDeath.Household_Remove(p, true);
                            if (p.IsValid || p.IsValidDescription)
                            {
                                SimDescCleanseTask.SafeCallSimDescCleanseO1(p);
                            }
                            p.mSim = Bim.nullsim;
                        }
                    }
                });

                CreateSimDesc(null, CASAgeGenderFlags.None, CASAgeGenderFlags.None, default(ResourceKey), 0, null, WorldName.Undefined, 0, false);
                CreatePetBabyPetSimDescription(null, null, null, null, false, GeneticsPet.SetName.DoNotSetName, null, -1, OccultTypes.None, WorldName.Undefined);
                CreatePetFamily(null, null, CASAgeGenderFlags.None, CASAgeGenderFlags.None, CASAgeGenderFlags.None, null, false, GeneticsPet.SetName.DoNotSetName, -1, OccultTypes.None);
                CreatePet(null, CASAgeGenderFlags.None, CASAgeGenderFlags.None, CASAgeGenderFlags.None, null, WorldName.Undefined);
                CreateRobot(default(ResourceKey));

                CheckLoop = 0;
            }
        }