Skip to content

Commit 1d4f99c

Browse files
committed
Fix crash for scopes with target illumination
1 parent 7e2fbfd commit 1d4f99c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/xrGame/Weapon.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4669,4 +4669,14 @@ void CWeapon::MakeWeaponKick(Fvector& pos, Fvector& dir)
46694669

46704670
Level().BulletManager().AddBullet(pos, tmpdir, 10000.0f, m_fast_kick_params.hp, m_fast_kick_params.imp, H_Parent()->ID(), ID(), m_fast_kick_params.htype, m_fast_kick_params.hdist, c, 1.0f, true, false);
46714671
}
4672+
}
4673+
4674+
void CWeapon::net_Relcase(CObject* object)
4675+
{
4676+
inherited::net_Relcase(object);
4677+
4678+
if (!m_zoom_params.m_pVision)
4679+
return;
4680+
4681+
m_zoom_params.m_pVision->remove_links(object);
46724682
}

src/xrGame/Weapon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CWeapon : public CHudItemObject,
5050
virtual void net_Destroy ();
5151
virtual void net_Export (NET_Packet& P);
5252
virtual void net_Import (NET_Packet& P);
53-
53+
virtual void net_Relcase (CObject* object);
5454
virtual CWeapon *cast_weapon () {return this;}
5555
virtual CWeaponBinoculars* cast_weapon_binoculars() { return nullptr; }
5656
virtual CWeaponKnife* cast_weapon_knife() { return nullptr; }

0 commit comments

Comments
 (0)