From dd30a38bb1f6f302f80f5528d5f477e0a8d527f9 Mon Sep 17 00:00:00 2001
From: revility <32818302+revility@users.noreply.github.com>
Date: Fri, 21 Sep 2018 14:01:23 -0400
Subject: [PATCH] Update Weapon.cpp

launch from barrel is no longer needed for projectiles to launch from the weapon's barrel, and then to the thirdperson cross hair position.  This fixes the projectiles not launching to the center of the thirdperson cross and also fixes the offset when aiming too high or too low.
projectiles in weapon.def files need launchfrombarrel set to 0 for this work.  the crosshair offsets also need to be adjust in the cursor.gui file as each one offset manually in Rivensin/Ruiner 2010 build.
---
 game/Weapon.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/game/Weapon.cpp b/game/Weapon.cpp
index ee3c2d6..70e4dcc 100644
--- a/game/Weapon.cpp
+++ b/game/Weapon.cpp
@@ -4843,8 +4843,8 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
 		
 		if ( barrelLaunch || tracer || beam ) { // Do not execute this part unless projectile is barrel launched or has a tracer effect.
 
-			gameLocal.clip.Translation( tr, view_pos, view_pos + dir * 4096.0f, NULL, mat3_identity, MASK_SHOT_RENDERMODEL, owner );
-			traceDist = (tr.endpos - view_pos).LengthSqr();
+			gameLocal.clip.Translation( tr, muzzle_pos, muzzle_pos + dir * 4096.0f, NULL, mat3_identity, MASK_SHOT_RENDERMODEL, owner );	//REVILITY 2018 WAS VIEW_POS
+			traceDist = (tr.endpos - muzzle_pos).LengthSqr();	//REVILITY 2018 WAS VIEW_POS.  THIS FIXES PROJECTILES FIRED FROM THE BARREL NOT GOING TO THE CROSSHAIR
 	
 			//ivan start - fix aim