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.
This commit is contained in:
revility 2018-09-21 14:01:23 -04:00 committed by Daniel Gibson
parent 85352e4a48
commit dd30a38bb1

View file

@ -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