| 324 | |
| 325 | extern short consistency[MAXPLAYERS][BACKUPTICS]; |
| 326 | void ReadTicCmd (uint8_t **stream, int player, int tic) |
| 327 | { |
| 328 | int type; |
| 329 | uint8_t *start; |
| 330 | ticcmd_t *tcmd; |
| 331 | |
| 332 | int ticmod = tic % BACKUPTICS; |
| 333 | |
| 334 | tcmd = &netcmds[player][ticmod]; |
| 335 | tcmd->consistency = ReadWord (stream); |
| 336 | |
| 337 | start = *stream; |
| 338 | |
| 339 | while ((type = ReadByte (stream)) != DEM_USERCMD && type != DEM_EMPTYUSERCMD) |
| 340 | Net_SkipCommand (type, stream); |
| 341 | |
| 342 | NetSpecs[player][ticmod].SetData (start, int(*stream - start - 1)); |
| 343 | |
| 344 | if (type == DEM_USERCMD) |
| 345 | { |
| 346 | UnpackUserCmd (&tcmd->ucmd, |
| 347 | tic ? &netcmds[player][(tic-1)%BACKUPTICS].ucmd : NULL, stream); |
| 348 | } |
| 349 | else |
| 350 | { |
| 351 | if (tic) |
| 352 | { |
| 353 | memcpy (&tcmd->ucmd, &netcmds[player][(tic-1)%BACKUPTICS].ucmd, sizeof(tcmd->ucmd)); |
| 354 | } |
| 355 | else |
| 356 | { |
| 357 | memset (&tcmd->ucmd, 0, sizeof(tcmd->ucmd)); |
| 358 | } |
| 359 | } |
| 360 | #if 0 |
| 361 | if (player==consoleplayer&&tic>BACKUPTICS) |
| 362 | assert(consistancy[player][ticmod] == tcmd->consistancy); |
| 363 | #endif |
| 364 | } |
| 365 | |
| 366 | void RunNetSpecs (int player, int buf) |
| 367 | { |
no test coverage detected