Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
init
  • Loading branch information
damoldavskiy committed May 5, 2025
commit c3a16cf054a0983627132d4b385f356e38fc9f26
13 changes: 13 additions & 0 deletions src/xrGame/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,19 @@ BOOL CWeapon::net_Spawn(CSE_Abstract* DC)

iAmmoElapsed = E->a_elapsed;
m_flagsAddOnState = E->m_addon_flags.get();

if (m_modular_attachments && (m_flagsAddOnState & CSE_ALifeItemWeapon::eWeaponAddonScope) != 0 && m_scopes.size() > 1)
{
m_cur_scope = ::Random.randI(1, m_scopes.size());
CWeaponMagazined* wm = smart_cast<CWeaponMagazined*>(this);
if (wm)
{
wm->LoadScopeKoeffs();
m_scopeItem = xr_new<CAnonHudItem>();
m_scopeItem->Load(m_scopes[m_cur_scope].c_str());
}
}

m_ammoType = E->ammo_type;
SetState(E->wpn_state);
SetNextState(E->wpn_state);
Expand Down
2 changes: 2 additions & 0 deletions src/xrGame/Weapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ class CWeapon : public CHudItemObject,
virtual bool IsHudModeNow();
virtual bool SOParentIsActor() { return ParentIsActor(); }
u8 last_idx;

CAnonHudItem* m_scopeItem = NULL;
public:
void signal_HideComplete();
virtual bool Action(u16 cmd, u32 flags);
Expand Down
2 changes: 0 additions & 2 deletions src/xrGame/WeaponMagazined.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class CWeaponMagazined : public CWeapon
// General
//êàäð ìîìåíòà ïåðåñ÷åòà UpdateSounds
u32 dwUpdateSounds_Frame;

CAnonHudItem* m_scopeItem = NULL;
protected:
virtual void OnMagazineEmpty();

Expand Down
Loading