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

◆ IsCategoryReachable()

bool AttachmentCategoriesRow::IsCategoryReachable ( EntityAI ent,
string categoryName,
float range = 1.5 )
inlineprotected

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

765 {
766 TypeAttachmentGroupsDataHolder holder = ent.GetTypeAttachmentGroupInfoHolder();
767 TypeAttachmentGroupData dataObj = holder.GetAttGroupDataByClassName(categoryName);
768 if (!dataObj)
769 return false;
770
771 string selectionName = dataObj.m_SelectionName;
772 if (ent.MemoryPointExists(selectionName))
773 {
774 vector position = ent.GetMemoryPointPos(selectionName);
775 position = ent.ModelToWorld(position);
776 vector posPlayer = g_Game.GetPlayer().GetPosition();
777 float heightDiff = posPlayer[1] - position[1];
778 float negativeTolerance = -range / 5;
779 posPlayer[1] = 0;
780 position[1] = 0;
781 //sort of 'dome' shaped detection with some negative leeway
782 return heightDiff >= negativeTolerance && (Math.AbsFloat(heightDiff) <= range) && vector.Distance(posPlayer, position) <= range;
783 }
784
785 return true;
786 }
DayZGame g_Game
Определения DayZGame.c:4074
vector position
Определения DustKickupEffects.c:20
string m_SelectionName
in imageset format
Определения TypeAttachmentGroupData.c:12
TypeAttachmentGroupData GetAttGroupDataByClassName(string groupName)
Returns single 'GUIInventoryAttachmentsProps' subclass data based on class name.

Перекрестные ссылки Math::AbsFloat(), vector::Distance(), g_Game, TypeAttachmentGroupsDataHolder::GetAttGroupDataByClassName(), TypeAttachmentGroupData::m_SelectionName и position.

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