Skip to content

Commit

Permalink
Dual wield tracer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Blixibon committed Jan 26, 2025
1 parent 1776328 commit f17d96f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sp/src/game/server/baseentity.h
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,9 @@ class CBaseEntity : public IServerEntity

// Computes the tracer start position
void ComputeTracerStartPosition( const Vector &vecShotSrc, Vector *pVecTracerStart );
#ifdef EZ2
virtual void OverrideTracerStartPosition( const Vector &vecShotSrc, Vector *pVecTracerStart ) {}
#endif

// Computes the tracer start position
void CreateBubbleTrailTracer( const Vector &vecShotSrc, const Vector &vecShotEnd, const Vector &vecShotDir );
Expand Down
14 changes: 14 additions & 0 deletions sp/src/game/server/ez2/ez2_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,20 @@ void CEZ2_Player::Weapon_HandleEquip( CBaseCombatWeapon *pWeapon )
}
}

//-----------------------------------------------------------------------------
// Purpose: Overrides bullet tracers
//-----------------------------------------------------------------------------
void CEZ2_Player::OverrideTracerStartPosition( const Vector &vecShotSrc, Vector *pVecTracerStart )
{
// TODO: Identify when doing dual wield secondary attack
/*if ()
{
Vector right;
EyeVectors( NULL, &right, NULL );
*pVecTracerStart -= right * 4;
}*/
}

//-----------------------------------------------------------------------------
// Purpose: Event fired upon picking up a new weapon
//-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions sp/src/game/server/ez2/ez2_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class CEZ2_Player : public CAI_ExpresserHost<CHL2_Player>, public CGameEventList
bool HandleRemoveFromPlayerSquad( CAI_BaseNPC *pNPC );

void Weapon_HandleEquip( CBaseCombatWeapon *pWeapon );
void OverrideTracerStartPosition( const Vector &vecShotSrc, Vector *pVecTracerStart );

void Event_FirstDrawWeapon( CBaseCombatWeapon *pWeapon );
void Event_ThrewGrenade( CBaseCombatWeapon *pWeapon );
Expand Down
5 changes: 5 additions & 0 deletions sp/src/game/shared/baseentity_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,11 @@ void CBaseEntity::ComputeTracerStartPosition( const Vector &vecShotSrc, Vector *
}
}
}

#if defined(EZ2) && defined(GAME_DLL)
// For dual wielded weapons
OverrideTracerStartPosition( vecShotSrc, pVecTracerStart );
#endif
}


Expand Down

0 comments on commit f17d96f

Please sign in to comment.