PMove: crouching will no longer affect your movement underwater. noclip and crouching will no longer adjust the camera view and player bbox.

This commit is contained in:
Marco Cawthorne 2022-07-14 21:38:54 -07:00
parent 2f8b36c499
commit b06544aacc
Signed by: eukara
GPG key ID: CE2032F0A2882A22
2 changed files with 15 additions and 8 deletions

View file

@ -101,8 +101,8 @@ NSClientPlayer:NSClientSpectator
int step;
float step_time;
int m_iUnderwaterDamage;
float m_flUnderwaterTime;
//float underwater_dmg;
float m_flPainTime;
entity last_used;

View file

@ -93,6 +93,9 @@ NSClientPlayer::Physics_Crouch(void)
{
bool crouchfix = false;
if (GetMovetype() != MOVETYPE_WALK)
return;
if (input_buttons & INPUT_BUTTON8) {
AddFlags(FL_CROUCHING);
} else {
@ -309,13 +312,17 @@ NSClientPlayer::Physics_InputPreMove(void)
input_movevalues *= 0.25;
}
/* move camera up (noclip, fly) when holding jump */
if (input_buttons & INPUT_BUTTON2) {
input_movevalues[2] = 240;
}
/* move camera down (noclip, fly) when holding crouching */
if (input_buttons & INPUT_BUTTON8) {
input_movevalues[2] = -240;
bool flying = ((GetMovetype() == MOVETYPE_NOCLIP) || (GetMovetype() == MOVETYPE_FLY));
if (flying == true) {
/* move camera up (noclip, fly) when holding jump */
if (input_buttons & INPUT_BUTTON2) {
input_movevalues[2] = 240;
}
/* move camera down (noclip, fly) when holding crouching */
if (input_buttons & INPUT_BUTTON8) {
input_movevalues[2] = -240;
}
}
if (flags & FL_FROZEN || movetype == MOVETYPE_NONE) {