From 6d9fb9e233c1310e553f856657f330bf3180dfd3 Mon Sep 17 00:00:00 2001 From: Balgus Date: Tue, 26 Jul 2005 00:42:45 +0000 Subject: [PATCH] Mantis 0000729: Changed code to ignore weapon level when determining recoil - it is now constant for pistol, LMG, HMG, and shotgun. Original code was left in-line as a precaution. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@300 67975925-1194-0748-b3d5-c16f83f1a3a1 --- releases/3.1/source/mod/AvHEvents.cpp | 32 ++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/releases/3.1/source/mod/AvHEvents.cpp b/releases/3.1/source/mod/AvHEvents.cpp index ca2d4038..b411c7d7 100644 --- a/releases/3.1/source/mod/AvHEvents.cpp +++ b/releases/3.1/source/mod/AvHEvents.cpp @@ -757,8 +757,13 @@ void EV_MachineGun(struct event_args_s* args) // General x-punch axis if ( EV_IsLocal( idx ) ) { + // Multiply punch by upgrade level - float theHalfSpread = (kMGXPunch/4.0f)*(theUpgradeLevel+1); + //float theHalfSpread = (kMGXPunch/4.0f)*(theUpgradeLevel+1); + + // Changed to ignore upgrade level + float theHalfSpread = (kMGXPunch/4.0f); + if(theHalfSpread > 0.0f) { V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) ); @@ -843,7 +848,11 @@ void EV_Pistol(struct event_args_s* args) if ( EV_IsLocal( idx ) ) { // Multiply punch by upgrade level - float theHalfSpread = (kHGXPunch/3.0f)*(theUpgradeLevel+1); + //float theHalfSpread = (kHGXPunch/3.0f)*(theUpgradeLevel+1); + + // Changed to ignore upgrade level + float theHalfSpread = (kHGXPunch/3.0f); + if(theHalfSpread > 0.0f) { V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) ); @@ -934,7 +943,12 @@ void EV_SonicGun(struct event_args_s* args) // General x-punch axis if ( EV_IsLocal( idx ) ) { - float theHalfSpread = (kSGXPunch/3.0f)*(theUpgradeLevel+1); + //float theHalfSpread = (kSGXPunch/3.0f)*(theUpgradeLevel+1); + + // Changed to ignore upgrade level + float theHalfSpread = (kSGXPunch/3.0f); + + if(theHalfSpread > 0.0f) { V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) ); @@ -1033,7 +1047,11 @@ void EV_HeavyMachineGun(struct event_args_s* args) // General x-punch axis if ( EV_IsLocal( idx ) ) { - float theHalfSpread = (kHMGXPunch/4.0f)*(theUpgradeLevel+1); + //float theHalfSpread = (kHMGXPunch/4.0f)*(theUpgradeLevel+1); + + // Changed to ignore upgrade level + float theHalfSpread = (kHMGXPunch/4.0f); + if(theHalfSpread > 0.0f) { V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) ); @@ -1112,7 +1130,11 @@ void EV_GrenadeGun(struct event_args_s* inArgs) // General x-punch axis if ( EV_IsLocal( idx ) ) { - float theHalfSpread = (kGGXPunch/2.0f)*(theUpgradeLevel+1); + //float theHalfSpread = (kGGXPunch/2.0f)*(theUpgradeLevel+1); + + // Changed to ignore upgrade level + float theHalfSpread = (kGGXPunch/2.0f); + if(theHalfSpread > 0.0f) { V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) );