public IEnumerable <FloatMenuOption> GetFloatMenuOptions(Caravan caravan, Site site)
 {
     if (!site.HasMap)
     {
         foreach (FloatMenuOption f in CaravanArrivalAction_VisitSite.GetFloatMenuOptions(caravan, site))
         {
             yield return(f);
         }
     }
 }
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                bool flag = false;

                switch (num)
                {
                case 0u:
                    if (site.HasMap)
                    {
                        goto IL_C6;
                    }
                    enumerator = CaravanArrivalAction_VisitSite.GetFloatMenuOptions(caravan, site).GetEnumerator();
                    num        = 4294967293u;
                    break;

                case 1u:
                    break;

                default:
                    return(false);
                }
                try
                {
                    switch (num)
                    {
                    }
                    if (enumerator.MoveNext())
                    {
                        f             = enumerator.Current;
                        this.$current = f;
                        if (!this.$disposing)
                        {
                            this.$PC = 1;
                        }
                        flag = true;
                        return(true);
                    }
                }
                finally
                {
                    if (!flag)
                    {
                        if (enumerator != null)
                        {
                            enumerator.Dispose();
                        }
                    }
                }
IL_C6:
                this.$PC = -1;
                return(false);
            }
Beispiel #3
0
        public IEnumerable <FloatMenuOption> GetFloatMenuOptions(Caravan caravan, Site site)
        {
            if (!site.HasMap)
            {
                using (IEnumerator <FloatMenuOption> enumerator = CaravanArrivalAction_VisitSite.GetFloatMenuOptions(caravan, site).GetEnumerator())
                {
                    if (enumerator.MoveNext())
                    {
                        FloatMenuOption f = enumerator.Current;
                        yield return(f);

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                }
            }
            yield break;
IL_00cf:
            /*Error near IL_00d0: Unexpected return in MoveNext()*/;
        }
Beispiel #4
0
        public static void Postfix(CaravanArrivalAction_VisitSite __instance, Caravan caravan, Site ___site)
        {
            if (!___site.HasMap)
            {
                LongEventHandler.QueueLongEvent(delegate()
                {
                    var filePreset = SettlementGeneration.GetPresetFor(___site, out LocationDef locationDef);
                    if (filePreset != null)
                    {
                        customSettlementGeneration = true;
                        locationData = new LocationData {
                            file = filePreset, locationDef = locationDef
                        };
                    }
                    Map orGenerateMap = GetOrGenerateMapUtility.GetOrGenerateMap(___site.Tile, null);
                    CaravanEnterMapUtility.Enter(caravan, orGenerateMap, CaravanEnterMode.Edge, 0, true, null);

                    if (filePreset != null)
                    {
                        SettlementGeneration.InitialiseLocationGeneration(orGenerateMap, filePreset, locationDef);
                    }
                }, "GeneratingMapForNewEncounter", false, null, true);
            }
        }
Beispiel #5
0
 public static void Prefix(CaravanArrivalAction_VisitSite __instance, Caravan caravan, Site ___site)
 {
     caravanArrival = true;
     Log.Message("GetOrGenerateMapPatch.caravanArrival true");
 }