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

◆ CheckRainTick()

void ItemBase::CheckRainTick ( )
inlineprivate

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

768 {
769 float rain_intensity = GetGame().GetWeather().GetRain().GetActual();
770
771 float wetness = rain_intensity * 20 * CHECK_RAIN_INTERVAL;
772
773 if (rain_intensity > 1 || rain_intensity < 0)
774 wetness = 0; // hackfix for weird values returned by weather system
775
776 if (wetness == 0)
777 wetness = -0.1 * CHECK_RAIN_INTERVAL;
778
779 int slots_count = GetGardenSlotsCount();
780
781 if ( rain_intensity > 0 )
782 {
784 SetSynchDirty();
785 }
786
787 for ( int i = 0; i < slots_count; i++ )
788 {
789 if ( m_Slots )
790 {
791 Slot slot = m_Slots.Get( i );
792
793 if ( slot )
794 {
795 slot.GiveWater( wetness * Math.RandomFloat01() );
796 }
797 }
798 }
799 }
proto native Weather GetWeather()
Returns weather controller object.
ref array< ref Slot > m_Slots
Определения GardenBase.c:25
void WaterAllSlots()
Определения GardenBase.c:802
int GetGardenSlotsCount()
Определения GardenBase.c:289
static const int CHECK_RAIN_INTERVAL
Определения GardenBase.c:23
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, Math::RandomFloat01() и WaterAllSlots().

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