Add mp_knife_wall_sparks cvar: spark effect when a knife hits a wall#1163
Open
belomaxorka wants to merge 1 commit into
Open
Add mp_knife_wall_sparks cvar: spark effect when a knife hits a wall#1163belomaxorka wants to merge 1 commit into
mp_knife_wall_sparks cvar: spark effect when a knife hits a wall#1163belomaxorka wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mp_knife_wall_sparks cvar: spark effect when a knife hits a wall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New cvar
mp_knife_wall_sparks(default0— original behavior). When enabled, a spark effect (TE_SPARKS) is shown at the point of impact whenever a knife hits a wall — both for the slash (CKnife::Swing) and the stab (CKnife::Stab) attack, in the exact code branches whereweapons/knife_hitwall1.wavis played.Why
This is a popular cosmetic tweak that servers currently implement with AMXX plugins that hook every
EmitSoundcall and reconstruct the impact point indirectly (viaget_user_aimingand distance heuristics), which is both inaccurate and wasteful. Native support is a one-liner per attack path using the existingUTIL_Sparks()utility:TraceResult;MSG_PVS(only to nearby players), notMSG_ALL;Implementation notes
#ifdef REGAMEDLL_ADD, vanilla builds are unaffected.0keeps the original behavior bit-for-bit.README.mdanddist/game.cfg.Tested
Verified on a live ReHLDS server (Windows, CS 1.6): with
mp_knife_wall_sparks 1sparks appear at the exact impact point for both attack buttons; with0behavior is identical to the original (sound only). The cvar can be toggled at runtime.