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

◆ CheckIfParentIsInCargo()

void EntityLightSource::CheckIfParentIsInCargo ( )
inlineprivate

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

597 {
598 // TO DO: OPTIMIZE AND REFACTOR! THIS MUST BE HANDLED IN AN EVENT, NOT PER FRAME!
599
600 if (m_Parent)
601 {
602 EntityAI parent_EAI = EntityAI.Cast( m_Parent );
603
604 if (parent_EAI) // Check if the Cast was successfull
605 {
606 GameInventory GI = parent_EAI.GetInventory();
607
608 if (GI) // Prevents handling of light on the parent item when it's projected in inventory as the item in inventory character's hands.
609 {
610 bool is_in_cargo = GI.IsInCargo();
611
612 if (!is_in_cargo)
613 {
614 EntityAI parent2 = parent_EAI.GetHierarchyParent();
615
616 if (parent2 && parent2.GetInventory())
617 {
618 is_in_cargo = parent2.GetInventory().IsInCargo();
619 }
620 }
621
622 if ( is_in_cargo )
623 {
624 SetEnabled(false);
625 }
626 else
627 {
628 SetEnabled(true);
629 }
630 }
631 }
632 }
633 }
class LogManager EntityAI
void SetEnabled()
prevents insider adding in the wrong position, HOTFIX
Определения TrapTrigger.c:119
Object m_Parent
Определения ScriptedLightBase.c:36
bool IsInCargo()
Returns true if this Inventory owner is in cargo of something.

Перекрестные ссылки GameInventory::IsInCargo(), m_Parent и SetEnabled().

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