From 8b668f64a563f01e46fb47b40126a601c71bab60 Mon Sep 17 00:00:00 2001 From: 1upD <1upderek@gmail.com> Date: Thu, 8 Nov 2018 22:28:33 -0500 Subject: [PATCH] Flaregun: Flare velocity should be relative to the player's. This way you can arc shots and shoot while running forward. --- sp/src/game/server/mod/weapon_custom_flaregun.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sp/src/game/server/mod/weapon_custom_flaregun.cpp b/sp/src/game/server/mod/weapon_custom_flaregun.cpp index 688d8545..581f47cb 100644 --- a/sp/src/game/server/mod/weapon_custom_flaregun.cpp +++ b/sp/src/game/server/mod/weapon_custom_flaregun.cpp @@ -112,8 +112,10 @@ void CFlaregun::PrimaryAttack( void ) Vector forward; pOwner->EyeVectors( &forward ); + forward *= 1500; - pFlare->SetAbsVelocity( forward * 1500 ); + // Add the player's velocity to the forward vector so that the flare follows the player's motion + pFlare->SetAbsVelocity(forward + pOwner->GetAbsVelocity()); pFlare->SetGravity(1.0f); pFlare->SetFriction(0.85f); pFlare->SetMoveType(MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE); @@ -150,8 +152,10 @@ void CFlaregun::SecondaryAttack( void ) Vector forward; pOwner->EyeVectors( &forward ); + forward *=500; - pFlare->SetAbsVelocity( forward * 500 ); + // Add the player's velocity to the forward vector so that the flare follows the player's motion + pFlare->SetAbsVelocity( forward + pOwner->GetAbsVelocity()); pFlare->SetGravity(1.0f); pFlare->SetFriction( 0.85f ); pFlare->SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE ); @@ -374,5 +378,5 @@ void CFlareGunProjectile::IgniteOtherIfAllowed(CBaseEntity * pOther) CBreakableProp *pBreakable; pBreakable = dynamic_cast(pOther); if (pBreakable) - pBreakable->IgniteLifetime(30.0f); + pBreakable->IgniteLifetime(10.0f); } \ No newline at end of file