Called when 2D optics are about to be drawn.
4031 {
4032 array<InventoryItem> optics;
4033
4034
4036 {
4037 HumanInventory inventory = GetHumanInventory();
4039
4041 if (opticsInHands)
4042 {
4043 preferredOptics = opticsInHands;
4044 }
4045 else
4046 {
4047 Weapon_Base weaponInHands = Weapon_Base.Cast(itemInHands);
4048 if (weaponInHands)
4049 {
4050 preferredOptics = weaponInHands.GetAttachedOptics();
4051 }
4052 }
4053 }
4054
4055
4057 {
4058 optics = {};
4059 optics.Insert(preferredOptics);
4060 }
4061
4062
4063 CachedEquipmentStorageQuery query = new CachedEquipmentStorageQuery();
4064
4068
4070
4072 foreach (Entity nvg : nvgs)
4073 {
4075 break;
4076 }
4077
4078 if (nvAttachment)
4079 {
4081 if ((!blockedByOptics || preferredOptics.
IsUsableWithNV()) && PlayerBase.Cast(
this).IsNVGWorking())
4082 {
4083 NVGoggles goggles = NVGoggles.Cast(nvAttachment);
4084 if (goggles)
4085 {
4086 if (!optics)
4087 optics = {};
4088
4089 optics.Insert(goggles);
4090 }
4091 }
4092 }
4093
4094 return optics;
4095 }
ECachedEquipmentItemCategory
ECachedEquipmentPlacement
StarlightOptic ItemOptics
array< Entity > GetEntitiesByCategory(CachedEquipmentStorageQuery query)
List of entities matching the CachedEquipmentStorageQuery query.
ECachedEquipmentItemCategory m_Category
ref TIntArray m_ParentPlacement
ECachedEquipmentPlacement m_Placement
override CachedEquipmentStorage GetCachedEquipment()
proto native EntityAI GetEntityInHands()
bool IsUsingOptics2DModel()
Returns whether this ItemOptics uses the 2D optics model.
proto native bool IsInOptics()
is weapon in optics mode or not