727 {
728 float nearest_distance = 1000.0;
729 int nearest_slot_index = -1;
731 for ( int i = 0; i < slots_count; i++ )
732 {
734
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)
ref array< ref Slot > m_Slots
int GetGardenSlotsCount()