private static IEnumerable <Thing> RelevantGear(Pawn pawn, StatDef stat)
        {
            if (pawn.apparel != null)
            {
                foreach (Apparel item in pawn.apparel.WornApparel)
                {
                    if (StatWorker.GearAffectsStat(item.def, stat))
                    {
                        yield return((Thing)item);

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                }
            }
            if (pawn.equipment != null)
            {
                foreach (ThingWithComps item2 in pawn.equipment.AllEquipmentListForReading)
                {
                    if (StatWorker.GearAffectsStat(item2.def, stat))
                    {
                        yield return((Thing)item2);

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                }
            }
            yield break;
IL_01a0:
            /*Error near IL_01a1: Unexpected return in MoveNext()*/;
        }
Esempio n. 2
0
 private static IEnumerable <Thing> RelevantGear(Pawn pawn, StatDef stat)
 {
     if (pawn.apparel != null)
     {
         foreach (Apparel t in pawn.apparel.WornApparel)
         {
             if (StatWorker.GearAffectsStat(t.def, stat))
             {
                 yield return(t);
             }
         }
     }
     if (pawn.equipment != null)
     {
         foreach (ThingWithComps t2 in pawn.equipment.AllEquipmentListForReading)
         {
             if (StatWorker.GearAffectsStat(t2.def, stat))
             {
                 yield return(t2);
             }
         }
     }
 }
Esempio n. 3
0
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

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

                switch (num)
                {
                case 0u:
                    if (pawn.apparel == null)
                    {
                        goto IL_E5;
                    }
                    enumerator = pawn.apparel.WornApparel.GetEnumerator();
                    num        = 4294967293u;
                    break;

                case 1u:
                    break;

                case 2u:
Block_5:
                    try
                    {
                        switch (num)
                        {
                        case 2u:
IL_175:
                            break;
                        }
                        if (enumerator2.MoveNext())
                        {
                            t2 = enumerator2.Current;
                            if (StatWorker.GearAffectsStat(t2.def, stat))
                            {
                                this.$current = t2;
                                if (!this.$disposing)
                                {
                                    this.$PC = 2;
                                }
                                flag = true;
                                return(true);
                            }
                            goto IL_175;
                        }
                    }
                    finally
                    {
                        if (!flag)
                        {
                            ((IDisposable)enumerator2).Dispose();
                        }
                    }
                    goto IL_1A2;

                default:
                    return(false);
                }
                try
                {
                    switch (num)
                    {
                    case 1u:
IL_B8:
                        break;
                    }
                    if (enumerator.MoveNext())
                    {
                        t = enumerator.Current;
                        if (StatWorker.GearAffectsStat(t.def, stat))
                        {
                            this.$current = t;
                            if (!this.$disposing)
                            {
                                this.$PC = 1;
                            }
                            flag = true;
                            return(true);
                        }
                        goto IL_B8;
                    }
                }
                finally
                {
                    if (!flag)
                    {
                        ((IDisposable)enumerator).Dispose();
                    }
                }
IL_E5:
                if (pawn.equipment != null)
                {
                    enumerator2 = pawn.equipment.AllEquipmentListForReading.GetEnumerator();
                    num         = 4294967293u;
                    goto Block_5;
                }
IL_1A2:
                this.$PC = -1;
                return(false);
            }