1776 {
1777 if (!IsAlive())
1778 {
1780 {
1782 }
1783 return;
1784 }
1785
1786 bool bADSToggle = false;
1787 bool exitSights = false;
1788 HumanInputController hic = GetInputController();
1791 PlayerBase playerPB = PlayerBase.Cast(this);
1793
1794 if (playerPB.IsRolling())
1795 {
1796 exitSights = true;
1797 }
1798
1800 {
1803 }
1804
1806 {
1808 exitSights = true;
1809 }
1810 else
1811 {
1813 {
1815 bADSToggle = true;
1816 }
1817
1819 {
1822 {
1823 bADSToggle = false;
1824 exitSights = true;
1825 }
1826 else
1827 {
1828 bADSToggle = true;
1829 }
1830 }
1831 }
1832
1833 if (bADSToggle && !GetCommand_Melee2() && !
GetThrowing().IsThrowingModeEnabled())
1834 {
1835 if (hia.IsItemInHandsWeapon() && playerPB.GetItemInHands() && playerPB.GetItemInHands().IsWeapon() && playerPB.GetWeaponManager() && !playerPB.GetWeaponManager().IsRunning())
1836 {
1837 Weapon_Base weapon = Weapon_Base.Cast(GetHumanInventory().GetEntityInHands());
1838 ItemOptics optic = weapon.GetAttachedOptics();
1839 bool switchToADS = false;
1840 bool canUseIronsights = weapon.CanEnterIronsights();
1841 bool canUseOptics = optic != NULL;
1842
1843 if (canUseIronsights || canUseOptics)
1845
1846
1850 {
1851 switchToADS = false;
1852 }
1853
1854
1856 {
1857 exitSights = true;
1858 }
1859 else if (switchToADS)
1860 {
1861
1862 if (weapon.GetWasIronSight() && !canUseIronsights)
1863 {
1864 weapon.SetWasIronSight(false);
1865 }
1866 else if (!weapon.GetWasIronSight() && !canUseOptics)
1867 {
1868 weapon.SetWasIronSight(true);
1869 }
1870
1871 if (weapon.GetWasIronSight())
1872 {
1875 }
1876 else if (!weapon.GetWasIronSight() || (!canUseIronsights && canUseOptics))
1877 {
1880 }
1881 else
1882 {
1883 exitSights = true;
1884 }
1885
1887 {
1889 }
1890 }
1891 else
1892 {
1893 exitSights = true;
1894 }
1895 }
1896 }
1897
1898
1900 {
1902 }
1903 }
void ResetWeaponRaiseProgress()
DayZPlayerImplementThrowing GetThrowing()
bool IsWeaponRaiseCompleted()
void SetIronsights(bool value)
ref HumanMovementState m_MovementState
time step for gradual update of dead screen visibilibty up to full visbility [s]
bool IsHandheldOpticsInUse()
DayZPlayerInventory GetDayZPlayerInventory()
void SwitchOptics(ItemOptics optic, bool state)
proto native void SetADS(bool pState)
sets head tilt to optics
DayZPlayerConstants
defined in C++
void HumanCommandWeapons()