Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CPlayerMgr::HandleWeaponChanged(uint8 nWeaponId, uint8 nAmmoId, bool bImmediateSwitch)
- {
- // Turn off zooming...
- HandleZoomChange( LTTRUE );
- // Tell the server to change weapons...
- LTRESULT ltResult;
- CAutoMessage cMsg;
- cMsg.Writeuint8( MID_WEAPON_CHANGE );
- cMsg.Writeuint8( nWeaponId );
- cMsg.Writeuint8( nAmmoId );
- ltResult = g_pLTClient->SendToServer( cMsg.Read(), MESSAGE_GUARANTEED );
- ASSERT( LT_OK == ltResult );
- // this isn't strictly necessary, the hide should have been
- // called when we entered the chase view
- if ( m_pPlayerCamera->IsChaseView() )
- {
- m_pClientWeaponMgr->HideWeapons();
- }
- //shutdown the weapon or ammo choosers...
- g_pInterfaceMgr->CloseChoosers();
- //when the swicth is complete...
- if (bImmediateSwitch)
- {
- //if we are changing to a gadget, we're done switching
- if (m_bChangingToGadget)
- {
- m_bChangingToGadget = false;
- }
- else
- {
- //we are not changing to a gadget, so forget about any gadget related stuff...
- if (m_nPreGadgetWeapon != WMGR_INVALID_ID )
- {
- m_nPreGadgetWeapon = WMGR_INVALID_ID;
- }
- }
- }
- m_bSwitchingWeapons = !bImmediateSwitch;
- }
- oid CPlayerObj::ChangeWeapon(uint8 nCommandId, LTBOOL bAuto, int32 nAmmoId)
- {
- if (!GetClient( )) return;
- CAutoMessage cMsg;
- cMsg.Writeuint8(MID_WEAPON_CHANGE);
- cMsg.Writeuint8(nCommandId);
- cMsg.Writeuint8(bAuto);
- cMsg.Writefloat((LTFLOAT)nAmmoId);
- g_pLTServer->SendToClient(cMsg.Read( ), GetClient( ), MESSAGE_GUARANTEED);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement