MCPcopy Create free account
hub / github.com/ZDoom/Raze / WriteUserCmdMessage

Function WriteUserCmdMessage

source/core/d_protocol.cpp:260–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260int 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
281int SkipTicCmd (uint8_t **stream, int count)

Callers 1

NetUpdateFunction · 0.85

Calls 3

WriteByteFunction · 0.85
PackUserCmdFunction · 0.85
isZeroMethod · 0.45

Tested by

no test coverage detected