DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CheckRainTick()

void ItemBase::CheckRainTick ( )
inlineprivate

См. определение в файле GardenBase.c строка 824

825 {
826 float rainIntensity = GetGame().GetWeather().GetRain().GetActual();
827 float wetness = rainIntensity * 20 * CHECK_RAIN_INTERVAL;
828
829 if (rainIntensity > 1 || rainIntensity < 0)
830 wetness = 0; // hackfix for weird values returned by weather system
831
832 if (wetness == 0)
833 wetness = -0.1 * CHECK_RAIN_INTERVAL;
834
835 // At the moment we dont want to remove water from the slot when it is not raining so we check and manipulate water quantity only when we add to it
836 if (rainIntensity > RAIN_INTENSITY_THRESHOLD)
837 {
838 if (wetness != 0) // only change slot water quantity when wetness value can actually add/deduct something
839 {
840 int slotsCount = GetGardenSlotsCount();
841 for (int i = 0; i < slotsCount; i++)
842 {
843 if (m_Slots)
844 {
845 Slot slot = m_Slots.Get(i);
846 if (slot)
847 {
848 slot.GiveWater(wetness * Math.RandomFloat01());
849 }
850 }
851 }
852 }
853 }
854 }
proto native Weather GetWeather()
Returns weather controller object.
ref array< ref Slot > m_Slots
Определения GardenBase.c:26
int GetGardenSlotsCount()
Определения GardenBase.c:351
static const float RAIN_INTENSITY_THRESHOLD
Определения GardenBase.c:24
static const int CHECK_RAIN_INTERVAL
Определения GardenBase.c:22
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native float GetActual()
proto native CGame GetGame()

Перекрестные ссылки CHECK_RAIN_INTERVAL, WeatherPhenomenon::GetActual(), GetGame(), GardenBase::GetGardenSlotsCount(), Weather::GetRain(), CGame::GetWeather(), m_Slots, RAIN_INTENSITY_THRESHOLD и Math::RandomFloat01().

Используется в EOnInit().