diff options
| author | Joe Ludwig <[email protected]> | 2013-12-03 08:54:16 -0800 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-12-03 08:54:16 -0800 |
| commit | beaae8ac45a2f322a792404092d4482065bef7ef (patch) | |
| tree | 747f35193ba235f0f0b070c05b53468a54559c8e /mp/src/game/server/baseprojectile.cpp | |
| parent | Make .xcconfigs text files too. (diff) | |
| download | source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.tar.xz source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.zip | |
Updated the SDK with the latest code from the TF and HL2 branches
* Adds support for Visual Studio 2012 and 2013
* VR Mode:
. Switches from headtrack.dll to sourcevr.dll
. Improved readability of the UI in VR
. Removed the IPD calibration tool. TF2 will now obey the Oculus
configuration file. Use the Oculus calibration tool in your SDK or
install and run "OpenVR" under Tools in Steam to calibrate your IPD.
. Added dropdown to enable VR mode in the Video options. Removed the -vr
command line option.
. Added the ability to switch in and out of VR mode without quitting the
game
. By default VR mode will run full screen. To switch back to a
borderless window set the vr_force_windowed convar.
. Added support for VR mode on Linux
* Many assorted bug fixes and other changes from Team Fortress in
various shared files
Diffstat (limited to 'mp/src/game/server/baseprojectile.cpp')
| -rw-r--r-- | mp/src/game/server/baseprojectile.cpp | 136 |
1 files changed, 0 insertions, 136 deletions
diff --git a/mp/src/game/server/baseprojectile.cpp b/mp/src/game/server/baseprojectile.cpp deleted file mode 100644 index 30d92fec..00000000 --- a/mp/src/game/server/baseprojectile.cpp +++ /dev/null @@ -1,136 +0,0 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: -// -//============================================================================= - -#include "cbase.h" -#include "baseprojectile.h" - -BEGIN_DATADESC( CBaseProjectile ) - DEFINE_FIELD( m_flDamage, FIELD_FLOAT ), - DEFINE_FIELD( m_iDamageType, FIELD_INTEGER ), - DEFINE_FIELD( m_flDamageScale, FIELD_FLOAT ), - - DEFINE_FUNCTION( ProjectileTouch ), - DEFINE_THINKFUNC( FlyThink ), -END_DATADESC() - -LINK_ENTITY_TO_CLASS( proj_base, CBaseProjectile ); - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -void CBaseProjectile::Spawn( void ) -{ - Precache(); - - SetModel( STRING( GetModelName() ) ); - - SetSolid( SOLID_BBOX ); - SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_CUSTOM ); - AddFlag( FL_OBJECT ); - - UTIL_SetSize( this, -Vector( 1.0f, 1.0f, 1.0f ), Vector( 1.0f, 1.0f, 1.0f ) ); - - // Setup attributes. - SetGravity( 0.001f ); - m_takedamage = DAMAGE_NO; - - // Setup the touch and think functions. - SetTouch( &CBaseProjectile::ProjectileTouch ); - SetThink( &CBaseProjectile::FlyThink ); - SetNextThink( gpGlobals->curtime ); -} - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -void CBaseProjectile::Precache( void ) -{ - BaseClass::Precache(); - - PrecacheModel( STRING( GetModelName() ) ); -} - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -CBaseProjectile *CBaseProjectile::Create( baseprojectilecreate_t &pCreate ) -{ - CBaseProjectile *pProjectile = static_cast<CBaseProjectile*>( CBaseEntity::CreateNoSpawn( "proj_base", pCreate.vecOrigin, vec3_angle, pCreate.pOwner ) ); - if ( !pProjectile ) - return NULL; - - pProjectile->SetModelName( pCreate.iszModel ); - pProjectile->SetDamage( pCreate.flDamage ); - pProjectile->SetDamageType( pCreate.iDamageType ); - pProjectile->SetDamageScale( pCreate.flDamageScale ); - pProjectile->SetAbsVelocity( pCreate.vecVelocity ); - - // Setup the initial angles. - QAngle angles; - VectorAngles( -pCreate.vecVelocity, angles ); - pProjectile->SetAbsAngles( angles ); - - // Spawn & Activate - DispatchSpawn( pProjectile ); - pProjectile->Activate(); - - return pProjectile; -} - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -unsigned int CBaseProjectile::PhysicsSolidMaskForEntity( void ) const -{ - return BaseClass::PhysicsSolidMaskForEntity() | CONTENTS_HITBOX; -} - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -void CBaseProjectile::ProjectileTouch( CBaseEntity *pOther ) -{ - // Verify a correct "other." - Assert( pOther ); - if ( !pOther->IsSolid() || pOther->IsSolidFlagSet( FSOLID_VOLUME_CONTENTS ) ) - return; - - // Handle hitting skybox (disappear). - const trace_t *pTrace = &CBaseEntity::GetTouchTrace(); - trace_t *pNewTrace = const_cast<trace_t*>( pTrace ); - - if( pTrace->surface.flags & SURF_SKY ) - { - UTIL_Remove( this ); - return; - } - - CTakeDamageInfo info; - info.SetAttacker( GetOwnerEntity() ); - info.SetInflictor( this ); - info.SetDamage( GetDamage() ); - info.SetDamageType( GetDamageType() ); - CalculateMeleeDamageForce( &info, GetAbsVelocity(), GetAbsOrigin(), GetDamageScale() ); - - Vector dir; - AngleVectors( GetAbsAngles(), &dir ); - - pOther->DispatchTraceAttack( info, dir, pNewTrace ); - ApplyMultiDamage(); - - UTIL_Remove( this ); -} - -//----------------------------------------------------------------------------- -// Purpose: Orient the projectile along its velocity -//----------------------------------------------------------------------------- -void CBaseProjectile::FlyThink( void ) -{ - QAngle angles; - VectorAngles( -(GetAbsVelocity()), angles ); - SetAbsAngles( angles ); - SetNextThink( gpGlobals->curtime + 0.1f ); -} |