summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/cl_input.c8
-rw-r--r--source/cl_parse.c4
-rw-r--r--source/cl_tent.c2
-rw-r--r--source/com_local.h2
-rw-r--r--source/protocol.h3
-rw-r--r--source/q_msg.c48
-rw-r--r--source/q_msg.h4
-rw-r--r--source/sv_main.c4
-rw-r--r--source/sv_user.c2
9 files changed, 46 insertions, 31 deletions
diff --git a/source/cl_input.c b/source/cl_input.c
index 5802571..36c51d2 100644
--- a/source/cl_input.c
+++ b/source/cl_input.c
@@ -598,6 +598,9 @@ void CL_UpdateCmd( int msec ) {
return;
}
+ // add to milliseconds of time to apply the move
+ cl.cmd.msec += msec;
+
// adjust viewangles
CL_AdjustAngles( msec );
@@ -607,9 +610,6 @@ void CL_UpdateCmd( int msec ) {
// allow mice or other external controllers to add to the move
CL_MouseMove();
- // add to milliseconds of time to apply the move
- cl.cmd.msec += msec;
-
CL_ClampPitch();
cl.cmd.angles[0] = ANGLE2SHORT( cl.viewangles[0] );
@@ -954,7 +954,7 @@ static void CL_SendBatchedCmd( void ) {
for( j = oldest->cmdNumber + 1; j <= history->cmdNumber; j++ ) {
cmd = &cl.cmds[j & CMD_MASK];
totalMsec += cmd->msec;
- bits = MSG_WriteDeltaUsercmd_Enhanced( oldcmd, cmd );
+ bits = MSG_WriteDeltaUsercmd_Enhanced( oldcmd, cmd, cls.protocolVersion );
if( cl_showpackets->integer == 3 ) {
MSG_ShowDeltaUsercmdBits_Enhanced( bits );
}
diff --git a/source/cl_parse.c b/source/cl_parse.c
index 5f2fb93..2a43e1c 100644
--- a/source/cl_parse.c
+++ b/source/cl_parse.c
@@ -844,7 +844,7 @@ static void CL_ParseServerData( void ) {
cl.pmp.speedMultiplier = 1;
cl.pmp.maxspeed = 300;
- cl.pmp.upspeed = 350;
+// cl.pmp.upspeed = 350;
cl.pmp.friction = 6;
cl.pmp.waterfriction = 1;
cl.pmp.flyfriction = 9;
@@ -894,7 +894,7 @@ static void CL_ParseServerData( void ) {
Com_DPrintf( "Q2PRO QWMod enabled\n" );
cl.pmp.maxspeed = 320;
- cl.pmp.upspeed = ((cl.pmp.qwmod == 2) ? 310 : 350);
+ //cl.pmp.upspeed = ((cl.pmp.qwmod == 2) ? 310 : 350);
cl.pmp.friction = 4;
cl.pmp.waterfriction = 4;
cl.pmp.airaccelerate = qtrue;
diff --git a/source/cl_tent.c b/source/cl_tent.c
index 7506ad5..d306ecc 100644
--- a/source/cl_tent.c
+++ b/source/cl_tent.c
@@ -141,7 +141,7 @@ void CL_AddLasers( void ) {
laser_t *l;
entity_t ent;
int i;
- color_t color;
+ //color_t color;
int time;
float f;
diff --git a/source/com_local.h b/source/com_local.h
index 5588d84..584a21a 100644
--- a/source/com_local.h
+++ b/source/com_local.h
@@ -798,7 +798,7 @@ typedef struct {
qboolean flyfix;
int qwmod;
float speedMultiplier;
- float upspeed;
+// float upspeed;
float maxspeed;
float friction;
float waterfriction;
diff --git a/source/protocol.h b/source/protocol.h
index 6cc6613..efd06c1 100644
--- a/source/protocol.h
+++ b/source/protocol.h
@@ -34,7 +34,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define PROTOCOL_VERSION_R1Q2_UCMD 1904 // b7387
#define PROTOCOL_VERSION_R1Q2_CURRENT 1904 // b7387
#define PROTOCOL_VERSION_Q2PRO_MINIMUM 1011 // r161
-#define PROTOCOL_VERSION_Q2PRO_CURRENT 1011 // r161
+#define PROTOCOL_VERSION_Q2PRO_UCMD 1012 // r179
+#define PROTOCOL_VERSION_Q2PRO_CURRENT 1012 // r179
#define PROTOCOL_VERSION_MVD_MINIMUM 2009 // r168
#define PROTOCOL_VERSION_MVD_CURRENT 2010 // r177
diff --git a/source/q_msg.c b/source/q_msg.c
index 85d1733..36b9c42 100644
--- a/source/q_msg.c
+++ b/source/q_msg.c
@@ -345,9 +345,10 @@ MSG_WriteDeltaUsercmd_Enhanced
=============
*/
int MSG_WriteDeltaUsercmd_Enhanced( const usercmd_t *from,
- const usercmd_t *cmd )
+ const usercmd_t *cmd,
+ int version )
{
- int bits, delta;
+ int bits, delta, count;
if( !from ) {
from = &nullUserCmd;
@@ -406,15 +407,21 @@ int MSG_WriteDeltaUsercmd_Enhanced( const usercmd_t *from,
MSG_WriteBits( cmd->angles[2], -16 );
}
- if( bits & CM_FORWARD ) {
- MSG_WriteBits( cmd->forwardmove, -16 );
- }
- if( bits & CM_SIDE ) {
- MSG_WriteBits( cmd->sidemove, -16 );
- }
- if( bits & CM_UP ) {
- MSG_WriteBits( cmd->upmove, -16 );
- }
+ if( version >= PROTOCOL_VERSION_Q2PRO_UCMD ) {
+ count = -10;
+ } else {
+ count = -16;
+ }
+
+ if( bits & CM_FORWARD ) {
+ MSG_WriteBits( cmd->forwardmove, count );
+ }
+ if( bits & CM_SIDE ) {
+ MSG_WriteBits( cmd->sidemove, count );
+ }
+ if( bits & CM_UP ) {
+ MSG_WriteBits( cmd->upmove, count );
+ }
if( bits & CM_BUTTONS ) {
int buttons = ( cmd->buttons & 3 ) | ( cmd->buttons >> 5 );
@@ -1770,9 +1777,10 @@ int MSG_ReadBits( int bits ) {
}
void MSG_ReadDeltaUsercmd_Enhanced( const usercmd_t *from,
- usercmd_t *to )
+ usercmd_t *to,
+ int version )
{
- int bits;
+ int bits, count;
if( from ) {
memcpy( to, from, sizeof( *to ) );
@@ -1804,16 +1812,22 @@ void MSG_ReadDeltaUsercmd_Enhanced( const usercmd_t *from,
if( bits & CM_ANGLE3 ) {
to->angles[2] = MSG_ReadBits( -16 );
}
-
+
// read movement
+ if( version >= PROTOCOL_VERSION_Q2PRO_UCMD ) {
+ count = -10;
+ } else {
+ count = -16;
+ }
+
if( bits & CM_FORWARD ) {
- to->forwardmove = MSG_ReadBits( -16 );
+ to->forwardmove = MSG_ReadBits( count );
}
if( bits & CM_SIDE ) {
- to->sidemove = MSG_ReadBits( -16 );
+ to->sidemove = MSG_ReadBits( count );
}
if( bits & CM_UP ) {
- to->upmove = MSG_ReadBits( -16 );
+ to->upmove = MSG_ReadBits( count );
}
// read buttons
diff --git a/source/q_msg.h b/source/q_msg.h
index 4abdf98..92a73b6 100644
--- a/source/q_msg.h
+++ b/source/q_msg.h
@@ -100,7 +100,7 @@ void MSG_WriteAngle( float f );
void MSG_WriteAngle16( float f );
void MSG_WriteBits( int value, int bits );
int MSG_WriteDeltaUsercmd( const usercmd_t *from, const usercmd_t *cmd, int version );
-int MSG_WriteDeltaUsercmd_Enhanced( const usercmd_t *from, const usercmd_t *cmd );
+int MSG_WriteDeltaUsercmd_Enhanced( const usercmd_t *from, const usercmd_t *cmd, int version );
void MSG_WriteDir ( const vec3_t vector);
void MSG_WriteDeltaEntity( const entity_state_t *from, const entity_state_t *to, msgEsFlags_t flags );
void MSG_WriteDeltaPlayerstate_Default( const player_state_t *from, const player_state_t *to );
@@ -129,7 +129,7 @@ float MSG_ReadAngle16 ( void );
int MSG_ReadBits( int bits );
void MSG_ReadDeltaUsercmd( const usercmd_t *from, usercmd_t *cmd );
void MSG_ReadDeltaUsercmd_Hacked( const usercmd_t *from, usercmd_t *to );
-void MSG_ReadDeltaUsercmd_Enhanced( const usercmd_t *from, usercmd_t *to );
+void MSG_ReadDeltaUsercmd_Enhanced( const usercmd_t *from, usercmd_t *to, int version );
void MSG_ReadDir( vec3_t vector );
void MSG_ReadData( void *buffer, int size );
int MSG_ParseEntityBits( int *bits );
diff --git a/source/sv_main.c b/source/sv_main.c
index ebd783d..515682d 100644
--- a/source/sv_main.c
+++ b/source/sv_main.c
@@ -811,7 +811,7 @@ static void SVC_DirectConnect( void ) {
if( sv_qwmod->integer ) {
newcl->pmp.qwmod = sv_qwmod->integer;
newcl->pmp.maxspeed = 320;
- newcl->pmp.upspeed = ( sv_qwmod->integer > 1 ) ? 310 : 350;
+ //newcl->pmp.upspeed = ( sv_qwmod->integer > 1 ) ? 310 : 350;
newcl->pmp.friction = 4;
newcl->pmp.waterfriction = 4;
newcl->pmp.airaccelerate = qtrue;
@@ -1742,7 +1742,7 @@ void SV_Init( void ) {
// set up default pmove parameters
//
sv_pmp.maxspeed = 300;
- sv_pmp.upspeed = 350;
+ //sv_pmp.upspeed = 350;
sv_pmp.friction = 6;
sv_pmp.flyfriction = 9;
sv_pmp.waterfriction = 1;
diff --git a/source/sv_user.c b/source/sv_user.c
index 333e61e..2a869f1 100644
--- a/source/sv_user.c
+++ b/source/sv_user.c
@@ -999,7 +999,7 @@ static void SV_NewClientExecuteMove( int c ) {
return;
}
cmd = &cmds[i][j];
- MSG_ReadDeltaUsercmd_Enhanced( lastcmd, cmd );
+ MSG_ReadDeltaUsercmd_Enhanced( lastcmd, cmd, sv_client->version );
cmd->lightlevel = lightlevel;
lastcmd = cmd;
}