| 945 | int gametime; |
| 946 | |
| 947 | void NetUpdate (void) |
| 948 | { |
| 949 | int lowtic; |
| 950 | int nowtime; |
| 951 | int newtics; |
| 952 | int i,j; |
| 953 | int realstart; |
| 954 | uint8_t *cmddata; |
| 955 | bool resendOnly; |
| 956 | |
| 957 | GC::CheckGC(); |
| 958 | |
| 959 | if (ticdup == 0) |
| 960 | { |
| 961 | return; |
| 962 | } |
| 963 | |
| 964 | // check time |
| 965 | nowtime = I_GetTime (); |
| 966 | newtics = nowtime - gametime; |
| 967 | gametime = nowtime; |
| 968 | |
| 969 | if (newtics <= 0) // nothing new to update |
| 970 | { |
| 971 | GetPackets (); |
| 972 | return; |
| 973 | } |
| 974 | |
| 975 | if (skiptics <= newtics) |
| 976 | { |
| 977 | newtics -= skiptics; |
| 978 | skiptics = 0; |
| 979 | } |
| 980 | else |
| 981 | { |
| 982 | skiptics -= newtics; |
| 983 | newtics = 0; |
| 984 | } |
| 985 | |
| 986 | // build new ticcmds for console player |
| 987 | for (i = 0; i < newtics; i++) |
| 988 | { |
| 989 | I_StartTic (); |
| 990 | D_ProcessEvents (); |
| 991 | if (pauseext || (maketic - gametic) / ticdup >= BACKUPTICS/2-1) |
| 992 | break; // can't hold any more |
| 993 | |
| 994 | //Printf ("mk:%i ",maketic); |
| 995 | G_BuildTiccmd (&localcmds[maketic % LOCALCMDTICS]); |
| 996 | maketic++; |
| 997 | |
| 998 | if (ticdup == 1 || maketic == 0) |
| 999 | { |
| 1000 | Net_NewMakeTic (); |
| 1001 | } |
| 1002 | else |
| 1003 | { |
| 1004 | // Once ticdup tics have been collected, average their movements |
no test coverage detected