Skip to content

Commit

Permalink
Remove identClient from userCmd_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Kangz committed Jan 20, 2015
1 parent d06d460 commit 8b46c65
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/engine/client/cg_api.h
Expand Up @@ -541,7 +541,7 @@ qboolean trap_GetSnapshot( int snapshotNumber, snapshot_t *snapshot );
qboolean trap_GetServerCommand( int serverCommandNumber ); qboolean trap_GetServerCommand( int serverCommandNumber );
int trap_GetCurrentCmdNumber( void ); int trap_GetCurrentCmdNumber( void );
qboolean trap_GetUserCmd( int cmdNumber, usercmd_t *ucmd ); qboolean trap_GetUserCmd( int cmdNumber, usercmd_t *ucmd );
void trap_SetUserCmdValue( int stateValue, int flags, float sensitivityScale, int mpIdentClient ); void trap_SetUserCmdValue( int stateValue, int flags, float sensitivityScale );
void trap_SetClientLerpOrigin( float x, float y, float z ); void trap_SetClientLerpOrigin( float x, float y, float z );
int trap_MemoryRemaining( void ); int trap_MemoryRemaining( void );
qboolean trap_Key_IsDown( int keynum ); qboolean trap_Key_IsDown( int keynum );
Expand Down
5 changes: 2 additions & 3 deletions src/engine/client/cl_cgame.cpp
Expand Up @@ -187,12 +187,11 @@ qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot )
CL_SetUserCmdValue CL_SetUserCmdValue
============== ==============
*/ */
void CL_SetUserCmdValue( int userCmdValue, int flags, float sensitivityScale, int mpIdentClient ) void CL_SetUserCmdValue( int userCmdValue, int flags, float sensitivityScale )
{ {
cl.cgameUserCmdValue = userCmdValue; cl.cgameUserCmdValue = userCmdValue;
cl.cgameFlags = flags; cl.cgameFlags = flags;
cl.cgameSensitivity = sensitivityScale; cl.cgameSensitivity = sensitivityScale;
cl.cgameMpIdentClient = mpIdentClient; // NERVE - SMF
} }


/* /*
Expand Down Expand Up @@ -1898,7 +1897,7 @@ intptr_t CL_CgameSystemCalls( intptr_t *args )
return CL_GetUserCmd( args[ 1 ], (usercmd_t*) VMA( 2 ) ); return CL_GetUserCmd( args[ 1 ], (usercmd_t*) VMA( 2 ) );


case CG_SETUSERCMDVALUE: case CG_SETUSERCMDVALUE:
CL_SetUserCmdValue( args[ 1 ], args[ 2 ], VMF( 3 ), args[ 4 ] ); CL_SetUserCmdValue( args[ 1 ], args[ 2 ], VMF( 3 ) );
return 0; return 0;


case CG_SETCLIENTLERPORIGIN: case CG_SETCLIENTLERPORIGIN:
Expand Down
2 changes: 0 additions & 2 deletions src/engine/client/cl_input.cpp
Expand Up @@ -713,8 +713,6 @@ void CL_FinishMove( usercmd_t *cmd )


cmd->flags = cl.cgameFlags; cmd->flags = cl.cgameFlags;


cmd->identClient = cl.cgameMpIdentClient; // NERVE - SMF

// send the current server time so the amount of movement // send the current server time so the amount of movement
// can be determined without allowing cheating // can be determined without allowing cheating
cmd->serverTime = cl.serverTime; cmd->serverTime = cl.serverTime;
Expand Down
1 change: 0 additions & 1 deletion src/engine/client/client.h
Expand Up @@ -143,7 +143,6 @@ typedef struct
int cgameUserCmdValue; // current weapon to add to usercmd_t int cgameUserCmdValue; // current weapon to add to usercmd_t
int cgameFlags; // flags that can be set by the gamecode int cgameFlags; // flags that can be set by the gamecode
float cgameSensitivity; float cgameSensitivity;
int cgameMpIdentClient; // NERVE - SMF
vec3_t cgameClientLerpOrigin; // DHM - Nerve vec3_t cgameClientLerpOrigin; // DHM - Nerve


// cmds[cmdNumber] is the predicted command, [cmdNumber-1] is the last // cmds[cmdNumber] is the predicted command, [cmdNumber-1] is the last
Expand Down
5 changes: 1 addition & 4 deletions src/engine/qcommon/msg.cpp
Expand Up @@ -816,7 +816,7 @@ void MSG_WriteDeltaUsercmd( msg_t *msg, usercmd_t *from, usercmd_t *to )
from->upmove == to->upmove && from->upmove == to->upmove &&
!memcmp( from->buttons, to->buttons, sizeof( from->buttons ) ) && !memcmp( from->buttons, to->buttons, sizeof( from->buttons ) ) &&
from->weapon == to->weapon && from->weapon == to->weapon &&
from->flags == to->flags && from->doubleTap == to->doubleTap && from->identClient == to->identClient ) from->flags == to->flags && from->doubleTap == to->doubleTap)
{ {
// NERVE - SMF // NERVE - SMF
MSG_WriteBits( msg, 0, 1 ); // no change MSG_WriteBits( msg, 0, 1 ); // no change
Expand All @@ -837,7 +837,6 @@ void MSG_WriteDeltaUsercmd( msg_t *msg, usercmd_t *from, usercmd_t *to )
MSG_WriteDelta( msg, from->weapon, to->weapon, 8 ); MSG_WriteDelta( msg, from->weapon, to->weapon, 8 );
MSG_WriteDelta( msg, from->flags, to->flags, 8 ); MSG_WriteDelta( msg, from->flags, to->flags, 8 );
MSG_WriteDelta( msg, from->doubleTap, to->doubleTap, 3 ); MSG_WriteDelta( msg, from->doubleTap, to->doubleTap, 3 );
MSG_WriteDelta( msg, from->identClient, to->identClient, 8 ); // NERVE - SMF
} }


/* /*
Expand Down Expand Up @@ -879,7 +878,6 @@ void MSG_ReadDeltaUsercmd( msg_t *msg, usercmd_t *from, usercmd_t *to )
to->weapon = MSG_ReadDelta( msg, from->weapon, 8 ); to->weapon = MSG_ReadDelta( msg, from->weapon, 8 );
to->flags = MSG_ReadDelta( msg, from->flags, 8 ); to->flags = MSG_ReadDelta( msg, from->flags, 8 );
to->doubleTap = MSG_ReadDelta( msg, from->doubleTap, 3 ) & 0x7; to->doubleTap = MSG_ReadDelta( msg, from->doubleTap, 3 ) & 0x7;
to->identClient = MSG_ReadDelta( msg, from->identClient, 8 ); // NERVE - SMF
} }
else else
{ {
Expand All @@ -893,7 +891,6 @@ void MSG_ReadDeltaUsercmd( msg_t *msg, usercmd_t *from, usercmd_t *to )
to->weapon = from->weapon; to->weapon = from->weapon;
to->flags = from->flags; to->flags = from->flags;
to->doubleTap = from->doubleTap; to->doubleTap = from->doubleTap;
to->identClient = from->identClient; // NERVE - SMF
} }
} }


Expand Down
5 changes: 0 additions & 5 deletions src/engine/qcommon/q_shared.h
Expand Up @@ -2345,11 +2345,6 @@ void ByteToDir( int b, vec3_t dir );
signed char forwardmove, rightmove, upmove; signed char forwardmove, rightmove, upmove;
byte doubleTap; // Arnout: only 3 bits used byte doubleTap; // Arnout: only 3 bits used


// rain - in ET, this can be any entity, and it's used as an array
// index, so make sure it's unsigned
// But Unv doesn't use it.
byte identClient; // NERVE - SMF

byte weapon; byte weapon;
byte flags; byte flags;


Expand Down
4 changes: 2 additions & 2 deletions src/gamelogic/cgame/cg_api.c
Expand Up @@ -770,9 +770,9 @@ qboolean trap_GetUserCmd( int cmdNumber, usercmd_t *ucmd )


//98. //98.
//CL_SetUserCmdValue(args[1], args[2], VMF(3), args[4]); //CL_SetUserCmdValue(args[1], args[2], VMF(3), args[4]);
void trap_SetUserCmdValue( int stateValue, int flags, float sensitivityScale, int mpIdentClient ) void trap_SetUserCmdValue( int stateValue, int flags, float sensitivityScale )
{ {
syscallVM( CG_SETUSERCMDVALUE, stateValue, flags, PASSFLOAT( sensitivityScale ), mpIdentClient ); syscallVM( CG_SETUSERCMDVALUE, stateValue, flags, PASSFLOAT( sensitivityScale ) );
} }


//99. //99.
Expand Down
2 changes: 1 addition & 1 deletion src/gamelogic/cgame/cg_view.c
Expand Up @@ -1884,7 +1884,7 @@ void CG_DrawActiveFrame( int serverTime, qboolean demoPlayback )
} }


// let the client system know what our weapon and zoom settings are // let the client system know what our weapon and zoom settings are
trap_SetUserCmdValue( cg.weaponSelect, 0, cg.zoomSensitivity, 0 ); trap_SetUserCmdValue( cg.weaponSelect, 0, cg.zoomSensitivity );


// this counter will be bumped for every valid scene we generate // this counter will be bumped for every valid scene we generate
cg.clientFrame++; cg.clientFrame++;
Expand Down

0 comments on commit 8b46c65

Please sign in to comment.