Пример #1
0
        private static IEnumerable <Blueprint_Build> PlaceSandbagBlueprints(Map map)
        {
            SiegeBlueprintPlacer.placedSandbagLocs.Clear();
            int numSandbags = SiegeBlueprintPlacer.NumSandbagRange.RandomInRange;
            int i           = 0;

            while (i < numSandbags)
            {
                IntVec3 bagRoot = SiegeBlueprintPlacer.FindSandbagRoot(map);
                if (bagRoot.IsValid)
                {
                    Rot4 growDirA = (bagRoot.x <= SiegeBlueprintPlacer.center.x) ? Rot4.East : Rot4.West;
                    Rot4 growDirB = (bagRoot.z <= SiegeBlueprintPlacer.center.z) ? Rot4.North : Rot4.South;
                    using (IEnumerator <Blueprint_Build> enumerator = SiegeBlueprintPlacer.MakeSandbagLine(bagRoot, map, growDirA, SiegeBlueprintPlacer.SandbagLengthRange.RandomInRange).GetEnumerator())
                    {
                        if (enumerator.MoveNext())
                        {
                            Blueprint_Build bag2 = enumerator.Current;
                            yield return(bag2);

                            /*Error: Unable to find new state assignment for yield return*/;
                        }
                    }
                    bagRoot += growDirB.FacingCell;
                    using (IEnumerator <Blueprint_Build> enumerator2 = SiegeBlueprintPlacer.MakeSandbagLine(bagRoot, map, growDirB, SiegeBlueprintPlacer.SandbagLengthRange.RandomInRange).GetEnumerator())
                    {
                        if (enumerator2.MoveNext())
                        {
                            Blueprint_Build bag = enumerator2.Current;
                            yield return(bag);

                            /*Error: Unable to find new state assignment for yield return*/;
                        }
                    }
                    i++;
                    continue;
                }
                break;
            }
            yield break;
IL_0271:
            /*Error near IL_0272: Unexpected return in MoveNext()*/;
        }
        private static IEnumerable <Blueprint_Build> PlaceSandbagBlueprints(Map map)
        {
            SiegeBlueprintPlacer.placedSandbagLocs.Clear();
            int numSandbags = SiegeBlueprintPlacer.NumSandbagRange.RandomInRange;

            for (int i = 0; i < numSandbags; i++)
            {
                IntVec3 bagRoot = SiegeBlueprintPlacer.FindSandbagRoot(map);
                if (!bagRoot.IsValid)
                {
                    yield break;
                }
                Rot4 growDirA;
                if (bagRoot.x > SiegeBlueprintPlacer.center.x)
                {
                    growDirA = Rot4.West;
                }
                else
                {
                    growDirA = Rot4.East;
                }
                Rot4 growDirB;
                if (bagRoot.z > SiegeBlueprintPlacer.center.z)
                {
                    growDirB = Rot4.South;
                }
                else
                {
                    growDirB = Rot4.North;
                }
                foreach (Blueprint_Build bag in SiegeBlueprintPlacer.MakeSandbagLine(bagRoot, map, growDirA, SiegeBlueprintPlacer.SandbagLengthRange.RandomInRange))
                {
                    yield return(bag);
                }
                bagRoot += growDirB.FacingCell;
                foreach (Blueprint_Build bag2 in SiegeBlueprintPlacer.MakeSandbagLine(bagRoot, map, growDirB, SiegeBlueprintPlacer.SandbagLengthRange.RandomInRange))
                {
                    yield return(bag2);
                }
            }
            yield break;
        }