Slope fix, set acceleration to 10 for now - also view-step prediction fix to make it not seem like you're falling at a constant pace.
This commit is contained in:
parent
0ac03b1bc6
commit
4260036e84
6 changed files with 7 additions and 49 deletions
|
@ -148,12 +148,6 @@ void Player_Predict(void) {
|
|||
self.movetype = MOVETYPE_NOCLIP;
|
||||
}
|
||||
|
||||
if (self.pmove_flags & 0x80000) {
|
||||
self.flags |= FL_ONGROUND;
|
||||
} else {
|
||||
self.flags &~= FL_ONGROUND;
|
||||
}
|
||||
|
||||
for ( int i = self.pmove_frame; i <= clientcommandframe; i++ ) {
|
||||
if ( input_timelength == 0 ) {
|
||||
break;
|
||||
|
@ -161,10 +155,6 @@ void Player_Predict(void) {
|
|||
getinputstate( i );
|
||||
runplayerphysics();
|
||||
}
|
||||
|
||||
if ( self.flags & FL_ONGROUND ) {
|
||||
self.pmove_flags |= 0x80000;
|
||||
}
|
||||
}
|
||||
|
||||
if ( autocvar_cl_smoothstairs && self.flags & FL_ONGROUND ) {
|
||||
|
@ -232,22 +222,12 @@ void Player_PreUpdate( void ) {
|
|||
self.movetype = MOVETYPE_NOCLIP;
|
||||
}
|
||||
|
||||
if ( self.pmove_flags & 0x80000 ) {
|
||||
self.flags |= FL_ONGROUND;
|
||||
} else {
|
||||
self.flags &~= FL_ONGROUND;
|
||||
}
|
||||
|
||||
//we want to predict an exact copy of the data in the new packet
|
||||
for ( ; self.pmove_frame <= servercommandframe; self.pmove_frame++ ) {
|
||||
if ( getinputstate( self.pmove_frame ) )
|
||||
runplayerphysics();
|
||||
}
|
||||
|
||||
if ( self.flags & FL_ONGROUND ) {
|
||||
self.pmove_flags |= 0x80000;
|
||||
}
|
||||
|
||||
//we now have self.pmove_flags set properly...
|
||||
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
|
|
|
@ -69,29 +69,7 @@ float Math_CRandom( void ) {
|
|||
void Damage_Apply( entity eTarget, entity eAttacker, int iDamage, vector vHitPos, int iSkipArmor );
|
||||
#endif
|
||||
void runplayerphysics(void)
|
||||
{ //operates on self
|
||||
float fallvel = ( self.flags & FL_ONGROUND )?0:-self.velocity_z;
|
||||
{
|
||||
Physics_Run();
|
||||
if ( ( self.flags & FL_ONGROUND ) && self.movetype == MOVETYPE_WALK && ( fallvel > 100 )) {
|
||||
#ifdef SSQC
|
||||
if ( fallvel > 580 ) {
|
||||
float fFallDamage = (fallvel-580) * ( 200 / ( 1024 - 580 ) );
|
||||
Damage_Apply( self, world, fFallDamage, self.origin, FALSE );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SSQC
|
||||
if ( cvar( "pm_bunnyspeedcap") == 0 ) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if ( serverkey( "pm_bunnyspeedcap") == 0 ) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ( fallvel > 245 ) {
|
||||
self.velocity *= 0.25;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -24,11 +24,11 @@ vector input_movevalues;
|
|||
float input_buttons;
|
||||
|
||||
#define PHYSICS_STEPHEIGHT 18
|
||||
#define PHYSICS_AIRSTEPHEIGHT 18
|
||||
#define PHYSICS_AIRSTEPHEIGHT 18
|
||||
#define PHYSICS_FRICTION 4
|
||||
#define PHYSICS_EDGEFRICTION 2
|
||||
#define PHYSICS_EDGEFRICTION 2
|
||||
#define PHYSICS_GRAVITY 800
|
||||
#define PHYSICS_ACCELERATE 4
|
||||
#define PHYSICS_ACCELERATE 10
|
||||
#define PHYSICS_STOPSPEED 100
|
||||
|
||||
#define PHYSICS_JUMP_CHAINWINDOW 0.5
|
||||
|
@ -314,12 +314,12 @@ void Physics_Run_Acceleration( float flMovetime, float flBefore ) {
|
|||
// acceleration
|
||||
f = flWishSpeed - ( self.velocity * vWishDirection );
|
||||
if ( f > 0 ) {
|
||||
self.velocity = self.velocity + vWishDirection * min( f, PHYSICS_ACCELERATE * flMovetime * flWishSpeed );
|
||||
self.velocity += vWishDirection * min( f, PHYSICS_ACCELERATE * flMovetime * flWishSpeed );
|
||||
}
|
||||
|
||||
} else {
|
||||
/*apply gravity*/
|
||||
self.velocity_z = self.velocity_z - ( PHYSICS_GRAVITY * flMovetime );
|
||||
self.velocity_z -= ( PHYSICS_GRAVITY * flMovetime );
|
||||
|
||||
if ( flWishSpeed < 30 ) {
|
||||
f = flWishSpeed - ( self.velocity * vWishDirection );
|
||||
|
@ -328,7 +328,7 @@ void Physics_Run_Acceleration( float flMovetime, float flBefore ) {
|
|||
}
|
||||
|
||||
if ( f > 0 ) {
|
||||
self.velocity = self.velocity + vWishDirection * ( min( f, PHYSICS_ACCELERATE ) * flWishSpeed * flMovetime );
|
||||
self.velocity += vWishDirection * ( min( f, PHYSICS_ACCELERATE ) * flWishSpeed * flMovetime );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
BIN
freecs/menu.dat
BIN
freecs/menu.dat
Binary file not shown.
BIN
freecs/progs.dat
BIN
freecs/progs.dat
Binary file not shown.
Loading…
Reference in a new issue