MCPcopy Create free account
hub / github.com/JACoders/OpenJK / CL_CreateNewCommands

Function CL_CreateNewCommands

code/client/cl_input.cpp:735–760  ·  view source on GitHub ↗

================= CL_CreateNewCommands Create a new usercmd_t structure for this frame ================= */

Source from the content-addressed store, hash-verified

733=================
734*/
735void CL_CreateNewCommands( void ) {
736 int cmdNum;
737
738 // no need to create usercmds until we have a gamestate
739// if ( cls.state < CA_PRIMED )
740// return;
741
742 frame_msec = com_frameTime - old_com_frameTime;
743
744 // if running over 1000fps, act as if each frame is 1ms
745 // prevents divisions by zero
746 if ( frame_msec < 1 )
747 frame_msec = 1;
748
749 // if running less than 5fps, truncate the extra time to prevent
750 // unexpected moves after a hitch
751 if ( frame_msec > 200 )
752 frame_msec = 200;
753
754 old_com_frameTime = com_frameTime;
755
756 // generate a command for this frame
757 cl.cmdNumber++;
758 cmdNum = cl.cmdNumber & CMD_MASK;
759 cl.cmds[cmdNum] = CL_CreateCmd();
760}
761
762/*
763=================

Callers 1

CL_SendCmdFunction · 0.70

Calls 1

CL_CreateCmdFunction · 0.70

Tested by

no test coverage detected