| 258 | } |
| 259 | |
| 260 | int WriteUserCmdMessage (InputPacket *ucmd, const InputPacket *basis, uint8_t **stream) |
| 261 | { |
| 262 | if (basis == NULL) |
| 263 | { |
| 264 | if (ucmd->actions != 0 || !ucmd->vel.isZero() || !ucmd->ang.isZero()) |
| 265 | { |
| 266 | WriteByte (DEM_USERCMD, stream); |
| 267 | return PackUserCmd (ucmd, basis, stream) + 1; |
| 268 | } |
| 269 | } |
| 270 | else if (ucmd->actions != basis->actions || ucmd->vel != basis->vel || ucmd->ang != basis->ang) |
| 271 | { |
| 272 | WriteByte (DEM_USERCMD, stream); |
| 273 | return PackUserCmd (ucmd, basis, stream) + 1; |
| 274 | } |
| 275 | |
| 276 | WriteByte (DEM_EMPTYUSERCMD, stream); |
| 277 | return 1; |
| 278 | } |
| 279 | |
| 280 | |
| 281 | int SkipTicCmd (uint8_t **stream, int count) |
no test coverage detected