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

◆ ProcessItemsDryness()

void ProcessItemsDryness ( )
protected

Dry items in player possession.

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

823 {
824 EntityAI attachment;
825 ItemBase item;
826
827 int attCount = m_Player.GetInventory().AttachmentCount();
828
829 #ifdef ENABLE_LOGGING
830 LogDryWetProcess(string.Format("Environment :: ProcessItemsDryness (update interval=%1s)", GameConstants.ENVIRO_TICK_RATE));
831 #endif
834
836 {
837 float distance = vector.Distance(m_UTemperatureSources[0].GetPosition(), m_Player.GetPosition());
838 distance = Math.Max(distance, 0.1);
839 drynessData.m_TemperatureSourceDistance = distance;
840 #ifdef ENABLE_LOGGING
841 LogDryWetProcess(string.Format("distance to heatsource: %1 m", distance));
842 #endif
843 }
844
845 for (int attIdx = 0; attIdx < attCount; ++attIdx)
846 {
847 attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
848 if (attachment && attachment.IsItemBase())
849 {
850 item = ItemBase.Cast(attachment);
851 if (item)
852 ApplyDrynessToItemEx(item, drynessData);
853 }
854 }
855
856 if (m_Player.GetItemInHands())
857 {
858 ApplyDrynessToItemEx(m_Player.GetItemInHands(), drynessData);
859 }
860
861 #ifdef ENABLE_LOGGING
862 LogDryWetProcess("==========");
863 #endif
864 }
ref array< UTemperatureSource > m_UTemperatureSources
Определения Environment.c:89
void ApplyDrynessToItemEx(ItemBase pItem, EnvironmentDrynessData pDrynessData)
Определения Environment.c:872
bool m_HasTemperatureSources
Определения Environment.c:87
DayZPlayer m_Player
Определения Hand_Events.c:42
float m_TemperatureSourceDistance
Определения Environment.c:19
bool m_UseTemperatureSources
Определения Environment.c:18
Определения EnMath.c:7
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Определения EnConvert.c:106
const float ENVIRO_TICK_RATE
Определения 3_Game/constants.c:720
static proto float Max(float x, float y)
Returns bigger of two given values.
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

Перекрестные ссылки ApplyDrynessToItemEx(), vector::Distance(), GameConstants::ENVIRO_TICK_RATE, GetPosition, m_HasTemperatureSources, m_Player, EnvironmentDrynessData::m_TemperatureSourceDistance, EnvironmentDrynessData::m_UseTemperatureSources, m_UTemperatureSources и Math::Max().

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