Exemplo n.º 1
0
        protected IEnumerator OnMissionUpdated()
        {
            double waitUntil = Frontiers.WorldClock.AdjustedRealTime + 1f;

            while (Frontiers.WorldClock.AdjustedRealTime < waitUntil)
            {
                yield return(null);
            }

            if (!Player.Local.Surroundings.IsVisitingStructure(structure))
            {
                if (LastTopCondition != null)
                {
                    //if we've been through this before
                    //check the last top condition again
                    MissionInteriorCondition newTopCondition = GetTopCondition();
                    if (newTopCondition != LastTopCondition)
                    {
                        LastTopCondition = newTopCondition;

                        structure.State.AdditionalInteriorVariants.Clear();
                        structure.State.AdditionalInteriorVariants.AddRange(LastTopCondition.StateVariable.InteriorVariants);

                        structure.State.InteriorCharacters.Clear();
                        structure.State.OwnerSpawn = LastTopCondition.StateVariable.OwnerSpawn;
                        structure.State.InteriorCharacters.AddRange(LastTopCondition.StateVariable.AdditionalInteriorCharacters);
                        //if we have a DIFFERENT condition than the last time
                        //we want to wipe the slate clean
                        //so add the interior to unload immediately
                        Structures.AddInteriorToUnload(structure);
                    }
                }
            }
            mUpdatingOverTime = false;
            yield break;
        }