private void DoCellSteadyEffects(IntVec3 c)
        {
            Room room  = c.GetRoom(this.map, RegionType.Set_All);
            bool flag  = this.map.roofGrid.Roofed(c);
            bool flag2 = room != null && room.UsesOutdoorTemperature;

            if (room == null || flag2)
            {
                if (this.outdoorMeltAmount > 0f)
                {
                    this.map.snowGrid.AddDepth(c, -this.outdoorMeltAmount);
                }
                if (!flag && this.snowRate > 0.001f)
                {
                    this.AddFallenSnowAt(c, 0.046f * this.map.weatherManager.SnowRate);
                }
            }
            if (room != null)
            {
                bool         protectedByEdifice = SteadyEnvironmentEffects.ProtectedByEdifice(c, this.map);
                TerrainDef   terrain            = c.GetTerrain(this.map);
                List <Thing> thingList          = c.GetThingList(this.map);
                for (int i = 0; i < thingList.Count; i++)
                {
                    Thing thing = thingList[i];
                    Filth filth = thing as Filth;
                    if (filth != null)
                    {
                        if (!flag && thing.def.filth.rainWashes && Rand.Chance(this.rainRate))
                        {
                            filth.ThinFilth();
                        }
                    }
                    else
                    {
                        this.TryDoDeteriorate(thing, flag, flag2, protectedByEdifice, terrain);
                    }
                }
                if (!flag2)
                {
                    float temperature = room.Temperature;
                    if (temperature > 0f)
                    {
                        float num = this.MeltAmountAt(temperature);
                        if (num > 0f)
                        {
                            this.map.snowGrid.AddDepth(c, -num);
                        }
                        if (room.RegionType.Passable() && temperature > SteadyEnvironmentEffects.AutoIgnitionTemperatureRange.min)
                        {
                            float value = Rand.Value;
                            if (value < SteadyEnvironmentEffects.AutoIgnitionTemperatureRange.InverseLerpThroughRange(temperature) * 0.7f && Rand.Chance(FireUtility.ChanceToStartFireIn(c, this.map)))
                            {
                                FireUtility.TryStartFireIn(c, this.map, 0.1f);
                            }
                            if (value < 0.33f)
                            {
                                MoteMaker.ThrowHeatGlow(c, this.map, 2.3f);
                            }
                        }
                    }
                }
            }
            this.map.gameConditionManager.DoSteadyEffects(c, this.map);
        }
 public static float FinalDeteriorationRate(Thing t, List <string> reasons = null)
 {
     if (t.Spawned)
     {
         Room room = t.GetRoom(RegionType.Set_Passable);
         return(SteadyEnvironmentEffects.FinalDeteriorationRate(t, t.Position.Roofed(t.Map), room != null && room.UsesOutdoorTemperature, SteadyEnvironmentEffects.ProtectedByEdifice(t.Position, t.Map), t.Position.GetTerrain(t.Map), reasons));
     }
     return(SteadyEnvironmentEffects.FinalDeteriorationRate(t, false, false, false, null, reasons));
 }