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

◆ GetNearestSlotIDByState()

int ItemBase::GetNearestSlotIDByState ( vector position,
int slot_state )
inlineprivate

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

727 {
728 float nearest_distance = 1000.0;
729 int nearest_slot_index = -1;
730 int slots_count = GetGardenSlotsCount();
731 for ( int i = 0; i < slots_count; i++ )
732 {
733 Slot slot = m_Slots.Get(i); // Move this line by a scope higher in this function after debugging
734
735 vector slot_pos = GetSlotPosition( i );
736 float current_distance = vector.Distance( position, slot_pos );
737
738 if ( current_distance < nearest_distance )
739 {
740 if ( slot != NULL && slot.m_State == slot_state )
741 {
742 nearest_distance = current_distance;
743 nearest_slot_index = i;
744 }
745 }
746 }
747
748 return nearest_slot_index;
749 }
vector GetSlotPosition(int index)
Определения GardenBase.c:751
ref array< ref Slot > m_Slots
Определения GardenBase.c:25
int GetGardenSlotsCount()
Определения GardenBase.c:289

Перекрестные ссылки vector::Distance(), GardenBase::GetGardenSlotsCount(), GetSlotPosition() и m_Slots.