void TacRefDlg::OnCamMove(AWEvent* event) { if (captured) { int mouse_dx = event->x - mouse_x; int mouse_dy = event->y - mouse_y; UpdateAzimuth( mouse_dx * 0.3 * DEGREES); UpdateElevation( mouse_dy * 0.3 * DEGREES); UpdateCamera(); mouse_x = event->x; mouse_y = event->y; } }
bool CVehicleMortar::FireMortar( float flFiringPower, float flFiringAccuracy, bool bRangeUpgraded, bool bAccuracyUpgraded ) { SetActivity( ACT_RANGE_ATTACK1 ); // Calculate the shot. Vector vStartPt; Vector vecTargetVel; float fallTime; if ( !CalcFireInfo( flFiringPower, flFiringAccuracy, bRangeUpgraded, bAccuracyUpgraded, vStartPt, vecTargetVel, fallTime ) ) { return false; } UpdateElevation( vecTargetVel ); // Create the round CMortarRound *pRound = CMortarRound::Create( vStartPt, vecTargetVel, GetOwner()->edict() ); pRound->SetLauncher( this ); pRound->ChangeTeam( GetTeamNumber() ); pRound->SetFallTime( fallTime ); // Start a falling sound just a bit before we begin to fall pRound->SetRoundType( MA_SHELL ); // BOOM! EmitSound( "VehicleMortar.FireSound" ); // Put in a delay before thinking again. m_bAllowedToFire = false; SetContextThink( NextFireThink, gpGlobals->curtime + MORTAR_FIRE_DELAY, g_pMortarNextFireContextName ); return true; }