Posted by: Mazor
Date posted: Mar 07 2004 User Rating: N/A | Number of views: 3376 Number of comments: 7 | Description: Notice how if you tap your crouch key very fast you bounce? This code will fix that. |
Fixing bouncy crouch code is one thing that I feel every mod should do before they release. It prevents the fact that players can tap their crouch code and bounce their player up and down rappidly, moving their hit boxes around causing them to be harder to hit in critical areas like the head. Here is how you fix that:
Open pm_shared.c Find the function PM_UnDuck() Then find this code:
| | if ( pmove->onground != -1 ) { for ( i = 0; i < 3; i++ ) { newOrigin[i] += ( pmove->player_mins[1][i] - pmove->player_mins[0][i] ); } }
|
Change that code block to look like this:
| | if ( pmove->onground != -1 && pmove->flags & FL_DUCKING && pmove->bInDuck == false) { for ( i = 0; i < 3; i++ ) { newOrigin[i] += ( pmove->player_mins[1][i] - pmove->player_mins[0][i] ); } }
|
Remember to compile both client and server dlls before you test this out!
Any questions? Email me: mazor@firearmsmod.com
-Cale 'Mazor' Dunlap Programmer Firearms Half-Life http://www.firearmsmod.com |
|
User Comments
Showing comments 1-7
i think i know why i didn't approve it now.. it doesn't do anything noticable in stock source at all. |
|
It actually does something.
Using stock code, rapidly press the duck key. You'll go up and down like a madman, and will make it difficult to hit your head.
Implement this code, and unless you hold the duck key down, you won't go down. |
|
This creates more problems then its worth, try jumping on a satchel charge once this code has been implemented, prepare for pogo vision. |
|
I put this code in FA because people exploited the hell out of the fact you can throw off the hitboxes by tapping the crouch key. Pogo vision is the last of my worries. |
|
I tried it with someone, did a before and after; and I see how it can be exploited. Useful for me :) |
|
Works for me as well. Would hate to have that kind of exploit in a mod. |
|
You must register to post a comment. If you have already registered, you must login.
|