Called when 2D optics are about to be drawn.
3887 {
3888 array<InventoryItem> optics;
3889
3890
3892 {
3893 HumanInventory inventory = GetHumanInventory();
3895
3897 if (opticsInHands)
3898 {
3899 preferredOptics = opticsInHands;
3900 }
3901 else
3902 {
3903 Weapon_Base weaponInHands = Weapon_Base.Cast(itemInHands);
3904 if (weaponInHands)
3905 {
3906 preferredOptics = weaponInHands.GetAttachedOptics();
3907 }
3908 }
3909 }
3910
3911
3913 {
3914 optics = {};
3915 optics.Insert(preferredOptics);
3916 }
3917
3918
3920 CachedEquipmentStorageQuery query = new CachedEquipmentStorageQuery();
3924 foreach (Entity nvg : nvgs)
3925 {
3927 break;
3928 }
3929
3930 if (nvAttachment)
3931 {
3933 if ((!blockedByOptics || preferredOptics.
IsUsableWithNV()) && PlayerBase.Cast(
this).IsNVGWorking())
3934 {
3935 NVGoggles goggles = NVGoggles.Cast(nvAttachment);
3936 if (goggles)
3937 {
3938 if (!optics)
3939 optics = {};
3940
3941 optics.Insert(goggles);
3942 }
3943 }
3944 }
3945
3946 return optics;
3947 }
ECachedEquipmentItemCategory
ECachedEquipmentPlacement
StarlightOptic ItemOptics
ECachedEquipmentItemCategory m_Category
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