MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / SwitchState

Method SwitchState

ogsr_engine/xrGame/Weapon.cpp:1719–1733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1717}
1718
1719void CWeapon::SwitchState(u32 S)
1720{
1721 SetNextState(S); // Very-very important line of code!!! :)
1722 if (CHudItem::object().Local() && !CHudItem::object().getDestroy() /* && (S!=NEXT_STATE)*/
1723 && m_pCurrentInventory)
1724 {
1725 // !!! Just single entry for given state !!!
1726 NET_Packet P;
1727 CHudItem::object().u_EventGen(P, GE_WPN_STATE_CHANGE, CHudItem::object().ID());
1728 P.w_u8(u8(S));
1729 P.w_u8(u8(m_sub_state));
1730 P.w_u8(u8(m_set_next_ammoType_on_reload & 0xff));
1731 CHudItem::object().u_EventSend(P, net_flags(TRUE, TRUE, FALSE, TRUE));
1732 }
1733}
1734
1735void CWeapon::OnMagazineEmpty() { VERIFY((u32)iAmmoElapsed == m_magazine.size()); }
1736

Callers 2

SendMessageMethod · 0.45

Calls 5

net_flagsFunction · 0.85
objectFunction · 0.50
u_EventGenMethod · 0.45
w_u8Method · 0.45
u_EventSendMethod · 0.45

Tested by

no test coverage detected