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

◆ ProcessItemsDryness()

void ProcessItemsDryness ( )
protected

Dry items in player possession.

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

826 {
827 EntityAI attachment;
828 ItemBase item;
829
830 int attCount = m_Player.GetInventory().AttachmentCount();
831
832 #ifdef ENABLE_LOGGING
833 LogDryWetProcess(string.Format("Environment :: ProcessItemsDryness (update interval=%1s)", GameConstants.ENVIRO_TICK_RATE));
834 #endif
837
839 {
840 float distance = vector.Distance(m_UTemperatureSources[0].GetPosition(), m_Player.GetPosition());
841 distance = Math.Max(distance, 0.1);
842 drynessData.m_TemperatureSourceDistance = distance;
843 #ifdef ENABLE_LOGGING
844 LogDryWetProcess(string.Format("distance to heatsource: %1 m", distance));
845 #endif
846 }
847
848 for (int attIdx = 0; attIdx < attCount; ++attIdx)
849 {
850 attachment = m_Player.GetInventory().GetAttachmentFromIndex(attIdx);
851 if (attachment && attachment.IsItemBase())
852 {
853 item = ItemBase.Cast(attachment);
854 if (item)
855 ApplyDrynessToItemEx(item, drynessData);
856 }
857 }
858
859 if (m_Player.GetItemInHands())
860 {
861 ApplyDrynessToItemEx(m_Player.GetItemInHands(), drynessData);
862 }
863
864 #ifdef ENABLE_LOGGING
865 LogDryWetProcess("==========");
866 #endif
867 }
map m_Player
ref array< UTemperatureSource > m_UTemperatureSources
Определения Environment.c:89
void ApplyDrynessToItemEx(ItemBase pItem, EnvironmentDrynessData pDrynessData)
Определения Environment.c:875
bool m_HasTemperatureSources
Определения Environment.c:87
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:119
const float ENVIRO_TICK_RATE
Определения 3_Game/DayZ/constants.c:723
static proto float Max(float x, float y)
Returns bigger of two given values.
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

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

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