From f5b4f06982f7a90f73130222c297c07be31d2290 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Fri, 24 Dec 2021 09:21:17 -0500 Subject: [PATCH 1/3] Simplify bullets effects code in ev_hldm.cpp --- cl_dll/ev_hldm.cpp | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 892f2ab51..94372b2f6 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -287,19 +287,8 @@ void EV_HLDM_DecalGunshot( pmtrace_t *pTrace, int iBulletType ) if ( pe && pe->solid == SOLID_BSP ) { - switch( iBulletType ) - { - case BULLET_PLAYER_9MM: - case BULLET_MONSTER_9MM: - case BULLET_PLAYER_MP5: - case BULLET_MONSTER_MP5: - case BULLET_PLAYER_BUCKSHOT: - case BULLET_PLAYER_357: - default: - // smoke and decal - EV_HLDM_GunshotDecalTrace( pTrace, EV_HLDM_DamageDecal( pe ) ); - break; - } + // smoke and decal + EV_HLDM_GunshotDecalTrace( pTrace, EV_HLDM_DamageDecal( pe ) ); } } @@ -331,16 +320,7 @@ int EV_HLDM_CheckTracer( int idx, float *vecSrc, float *end, float *forward, flo if ( iTracerFreq != 1 ) // guns that always trace also always decal tracer = 1; - switch( iBulletType ) - { - case BULLET_PLAYER_MP5: - case BULLET_MONSTER_MP5: - case BULLET_MONSTER_9MM: - case BULLET_MONSTER_12MM: - default: - EV_CreateTracer( vecTracerSrc, end ); - break; - } + EV_CreateTracer( vecTracerSrc, end ); } return tracer; From 78bd00d9252c78e8ee5e30c13a50c722a4cdf4b0 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Fri, 24 Dec 2021 10:10:43 -0500 Subject: [PATCH 2/3] Simplify bullets effects code in combat.cpp --- dlls/combat.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/dlls/combat.cpp b/dlls/combat.cpp index 5acd32b3e..70fd545f3 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -1417,23 +1417,15 @@ void CBaseEntity::FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting if ( iTracerFreq != 1 ) // guns that always trace also always decal tracer = 1; - switch( iBulletType ) - { - case BULLET_MONSTER_MP5: - case BULLET_MONSTER_9MM: - case BULLET_MONSTER_12MM: - default: - MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, vecTracerSrc ); - WRITE_BYTE( TE_TRACER ); - WRITE_COORD( vecTracerSrc.x ); - WRITE_COORD( vecTracerSrc.y ); - WRITE_COORD( vecTracerSrc.z ); - WRITE_COORD( tr.vecEndPos.x ); - WRITE_COORD( tr.vecEndPos.y ); - WRITE_COORD( tr.vecEndPos.z ); - MESSAGE_END(); - break; - } + MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, vecTracerSrc ); + WRITE_BYTE( TE_TRACER ); + WRITE_COORD( vecTracerSrc.x ); + WRITE_COORD( vecTracerSrc.y ); + WRITE_COORD( vecTracerSrc.z ); + WRITE_COORD( tr.vecEndPos.x ); + WRITE_COORD( tr.vecEndPos.y ); + WRITE_COORD( tr.vecEndPos.z ); + MESSAGE_END(); } // do damage, paint decals if (tr.flFraction != 1.0) From 7f3b6a8b23131d9b8b523ada27281d93a57ccb49 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lortie Date: Fri, 24 Dec 2021 10:10:55 -0500 Subject: [PATCH 3/3] Simplify bullets effects code in weapons.cpp --- dlls/weapons.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index f136374a4..cc8bdd44b 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -171,20 +171,10 @@ void DecalGunshot( TraceResult *pTrace, int iBulletType ) switch( iBulletType ) { - case BULLET_PLAYER_9MM: - case BULLET_MONSTER_9MM: - case BULLET_PLAYER_MP5: - case BULLET_MONSTER_MP5: - case BULLET_PLAYER_BUCKSHOT: - case BULLET_PLAYER_357: default: // smoke and decal UTIL_GunshotDecalTrace( pTrace, DamageDecal( pEntity, DMG_BULLET ) ); break; - case BULLET_MONSTER_12MM: - // smoke and decal - UTIL_GunshotDecalTrace( pTrace, DamageDecal( pEntity, DMG_BULLET ) ); - break; case BULLET_PLAYER_CROWBAR: // wall decal UTIL_DecalTrace( pTrace, DamageDecal( pEntity, DMG_CLUB ) );