mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2025-02-07 16:31:38 +00:00
pm_projectileOrigin added
New cvar to enable and disable launching projectiles from the weapon's world model barrel joint and also towards the crosshair's position. launchfrombarrel must be set to 0 in projectile def files to use. Done incase a weapon doesn't need it or has issues using it in the future. none currently do.
This commit is contained in:
parent
d92edb81e2
commit
1f82525502
2 changed files with 17 additions and 5 deletions
|
@ -231,6 +231,8 @@ idWeapon::idWeapon() {
|
||||||
Clear();
|
Clear();
|
||||||
|
|
||||||
fl.networkSync = true;
|
fl.networkSync = true;
|
||||||
|
|
||||||
|
projectileOrigin = 1; //rev 2018
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4843,12 +4845,20 @@ 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.
|
if ( barrelLaunch || tracer || beam ) { // Do not execute this part unless projectile is barrel launched or has a tracer effect.
|
||||||
|
|
||||||
gameLocal.clip.Translation( tr, muzzle_pos, muzzle_pos + dir * 4096.0f, NULL, mat3_identity, MASK_SHOT_RENDERMODEL, owner ); //REVILITY 2018 WAS VIEW_POS
|
//Rev start
|
||||||
traceDist = (tr.endpos - muzzle_pos).LengthSqr(); //REVILITY 2018 WAS VIEW_POS. THIS FIXES PROJECTILES FIRED FROM THE BARREL NOT GOING TO THE CROSSHAIR
|
projectileOrigin = cvarSystem->GetCVarInteger( "pm_projectileOrigin" );
|
||||||
|
if ( projectileOrigin > 0 ) {
|
||||||
|
gameLocal.clip.Translation( tr, muzzle_pos, muzzle_pos + dir * 4096.0f, NULL, mat3_identity, MASK_SHOT_RENDERMODEL, owner );
|
||||||
|
traceDist = (tr.endpos - muzzle_pos).LengthSqr(); //THIS FIXES PROJECTILES FIRED FROM THE BARREL NOT GOING TO THE CROSSHAIR
|
||||||
//Launching projectiles now always comes from the thirdperson weapon's barrel model... even in first person. Direction is always towards Thirdperson crosshair.
|
//Launching projectiles now always comes from the thirdperson weapon's barrel model... even in first person. Direction is always towards Thirdperson crosshair.
|
||||||
//Launchfrombarrel should be set to 0 in weapon defs. setting to 1 is no longer needed.
|
//Launchfrombarrel should be set to 0 in weapon defs. setting to 1 is no longer needed.
|
||||||
//ivan start - fix aim
|
} else {
|
||||||
|
gameLocal.clip.Translation( tr, view_pos, view_pos + dir * 4096.0f, NULL, mat3_identity, MASK_SHOT_RENDERMODEL, owner );
|
||||||
|
traceDist = (tr.endpos - view_pos).LengthSqr();
|
||||||
|
}
|
||||||
|
//Rev end
|
||||||
|
|
||||||
|
//ivan start - fix aim
|
||||||
// Problem: muzzleDistFromView is the dist from muzzle and viewpos.
|
// Problem: muzzleDistFromView is the dist from muzzle and viewpos.
|
||||||
// It was usually very low in D3.
|
// It was usually very low in D3.
|
||||||
// If tracer lenght was smaller than it, then we are too close to a wall/something and the aim was corrected.
|
// If tracer lenght was smaller than it, then we are too close to a wall/something and the aim was corrected.
|
||||||
|
|
|
@ -238,6 +238,8 @@ public:
|
||||||
//rev grab
|
//rev grab
|
||||||
int AmmoCount( void ) const; //new
|
int AmmoCount( void ) const; //new
|
||||||
|
|
||||||
|
int projectileOrigin; //rev 2018
|
||||||
|
|
||||||
//ivan start
|
//ivan start
|
||||||
bool HasToWalk( void ) const;
|
bool HasToWalk( void ) const;
|
||||||
float GetWalkSpeedMult( void ) const;
|
float GetWalkSpeedMult( void ) const;
|
||||||
|
|
Loading…
Reference in a new issue