diff --git a/qw/include/sv_demo.h b/qw/include/sv_demo.h index 58a3a8ffb..b11be4c66 100644 --- a/qw/include/sv_demo.h +++ b/qw/include/sv_demo.h @@ -124,7 +124,6 @@ extern struct cvar_s *sv_demotxt; extern struct cvar_s *serverdemo; void DemoWrite_Begin (byte type, int to, int size); -void SV_WriteClientToDemo (sizebuf_t *msg, int i, demo_client_t *cl); void SV_DemoWritePackets (int num); void SV_Stop (int reason); void DemoSetMsgBuf (demobuf_t *prev, demobuf_t *cur); diff --git a/qw/source/sv_demo.c b/qw/source/sv_demo.c index 969acc1a0..26d42214f 100644 --- a/qw/source/sv_demo.c +++ b/qw/source/sv_demo.c @@ -211,66 +211,6 @@ SV_DemoWriteToDisk (int type, int to, float time) } } -void -SV_WriteClientToDemo (sizebuf_t *msg, int i, demo_client_t *cl) -{ - float *origin, *angles; - int flags; - int j; - demoinfo_t *demoinfo = &demo.info[i]; - - origin = cl->info.origin; - angles = cl->info.angles; - - // now write it to buf - flags = cl->flags; - - for (j = 0; j < 3; j++) - if (origin[j] != demoinfo->origin[j]) - flags |= DF_ORIGIN << j; - - for (j = 0; j < 3; j++) - if (angles[j] != demoinfo->angles[j]) - flags |= DF_ANGLES << j; - - if (cl->info.model != demoinfo->model) - flags |= DF_MODEL; - if (cl->info.effects != demoinfo->effects) - flags |= DF_EFFECTS; - if (cl->info.skinnum != demoinfo->skinnum) - flags |= DF_SKINNUM; - if (cl->info.weaponframe != demoinfo->weaponframe) - flags |= DF_WEAPONFRAME; - - MSG_WriteByte (msg, svc_playerinfo); - MSG_WriteByte (msg, i); - MSG_WriteShort (msg, flags); - - MSG_WriteByte (msg, cl->frame); - - for (j = 0; j < 3; j++) - if (flags & (DF_ORIGIN << j)) - MSG_WriteCoord (msg, origin[j]); - - for (j = 0; j < 3; j++) - if (flags & (DF_ANGLES << j)) - MSG_WriteAngle16 (msg, angles[j]); - - if (flags & DF_MODEL) - MSG_WriteByte (msg, cl->info.model); - - if (flags & DF_SKINNUM) - MSG_WriteByte (msg, cl->info.skinnum); - - if (flags & DF_EFFECTS) - MSG_WriteByte (msg, cl->info.effects); - - if (flags & DF_WEAPONFRAME) - MSG_WriteByte (msg, cl->info.weaponframe); - - *demoinfo = cl->info; -} - void SV_DemoWritePackets (int num) { diff --git a/qw/source/sv_ents.c b/qw/source/sv_ents.c index 07179327d..77c27e5d2 100644 --- a/qw/source/sv_ents.c +++ b/qw/source/sv_ents.c @@ -395,6 +395,66 @@ SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *msg) MSG_WriteShort (msg, 0); // end of packetentities } +static void +SV_WriteClientToDemo (sizebuf_t *msg, int i, demo_client_t *cl) +{ + float *origin, *angles; + int flags; + int j; + demoinfo_t *demoinfo = &demo.info[i]; + + origin = cl->info.origin; + angles = cl->info.angles; + + // now write it to buf + flags = cl->flags; + + for (j = 0; j < 3; j++) + if (origin[j] != demoinfo->origin[j]) + flags |= DF_ORIGIN << j; + + for (j = 0; j < 3; j++) + if (angles[j] != demoinfo->angles[j]) + flags |= DF_ANGLES << j; + + if (cl->info.model != demoinfo->model) + flags |= DF_MODEL; + if (cl->info.effects != demoinfo->effects) + flags |= DF_EFFECTS; + if (cl->info.skinnum != demoinfo->skinnum) + flags |= DF_SKINNUM; + if (cl->info.weaponframe != demoinfo->weaponframe) + flags |= DF_WEAPONFRAME; + + MSG_WriteByte (msg, svc_playerinfo); + MSG_WriteByte (msg, i); + MSG_WriteShort (msg, flags); + + MSG_WriteByte (msg, cl->frame); + + for (j = 0; j < 3; j++) + if (flags & (DF_ORIGIN << j)) + MSG_WriteCoord (msg, origin[j]); + + for (j = 0; j < 3; j++) + if (flags & (DF_ANGLES << j)) + MSG_WriteAngle16 (msg, angles[j]); + + if (flags & DF_MODEL) + MSG_WriteByte (msg, cl->info.model); + + if (flags & DF_SKINNUM) + MSG_WriteByte (msg, cl->info.skinnum); + + if (flags & DF_EFFECTS) + MSG_WriteByte (msg, cl->info.effects); + + if (flags & DF_WEAPONFRAME) + MSG_WriteByte (msg, cl->info.weaponframe); + + *demoinfo = cl->info; +} + static void SV_WritePlayersToClient (client_t *client, edict_t *clent, byte *pvs, sizebuf_t *msg)