public static bool TryGetTemperatureForCell(IntVec3 c, Map map, out float tempResult)
        {
            if (map == null)
            {
                Log.Error("Got temperature for null map.");
                tempResult = 21f;
                return(true);
            }
            if (!c.InBounds(map))
            {
                tempResult = 21f;
                return(false);
            }
            if (GenTemperature.TryGetDirectAirTemperatureForCell(c, map, out tempResult))
            {
                return(true);
            }
            List <Thing> list = map.thingGrid.ThingsListAtFast(c);

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].def.passability == Traversability.Impassable)
                {
                    return(GenTemperature.TryGetAirTemperatureAroundThing(list[i], out tempResult));
                }
            }
            return(false);
        }
Beispiel #2
0
        float GetTemperature()
        {
            if (!Dead)             // avoid null reference exception
            {
                GenTemperature.TryGetAirTemperatureAroundThing(this, out lastTemperature);
            }

            return(lastTemperature);
        }