| 1717 | } |
| 1718 | |
| 1719 | void 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 | |
| 1735 | void CWeapon::OnMagazineEmpty() { VERIFY((u32)iAmmoElapsed == m_magazine.size()); } |
| 1736 |
no test coverage detected