Skip to content

Commit e6e9336

Browse files
committed
Fix safemode
1 parent e4d4da9 commit e6e9336

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/xrGame/Weapon.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,6 +1942,13 @@ bool CWeapon::Action(u16 cmd, u32 flags)
19421942
{
19431943
if (CActor* pActor = H_Parent()->cast_actor())
19441944
{
1945+
if (IsZoomed())
1946+
{
1947+
OnZoomOut();
1948+
}
1949+
1950+
ResetSubStateTime();
1951+
19451952
if (m_eAnimationsFlags.test(EAnimationsFlags::af_safemode_in_out))
19461953
{
19471954
SwitchState(eSafemodeSwitch);
@@ -1963,6 +1970,18 @@ bool CWeapon::Action(u16 cmd, u32 flags)
19631970
{
19641971
if (flags & CMD_START)
19651972
{
1973+
if (ParentIsActor())
1974+
{
1975+
if (CActor* pActor = H_Parent()->cast_actor())
1976+
{
1977+
if (pActor->IsSafemode())
1978+
{
1979+
ResetSubStateTime();
1980+
pActor->SetSafemodeStatus(false);
1981+
}
1982+
}
1983+
}
1984+
19661985
if (!IsZoomed())
19671986
{
19681987
if (!IsPending())
@@ -2006,6 +2025,18 @@ bool CWeapon::Action(u16 cmd, u32 flags)
20062025
{
20072026
if (flags & CMD_START)
20082027
{
2028+
if (ParentIsActor())
2029+
{
2030+
if (CActor* pActor = H_Parent()->cast_actor())
2031+
{
2032+
if (pActor->IsSafemode())
2033+
{
2034+
ResetSubStateTime();
2035+
pActor->SetSafemodeStatus(false);
2036+
}
2037+
}
2038+
}
2039+
20092040
if (!CanAimNow())
20102041
{
20112042
CActor* pActor = H_Parent() != nullptr ? H_Parent()->cast_actor() : nullptr;

0 commit comments

Comments
 (0)