diff options
-rw-r--r-- | source/mvd_client.c | 4 | ||||
-rw-r--r-- | source/sv_ac.c | 2 | ||||
-rw-r--r-- | source/sv_local.h | 2 | ||||
-rw-r--r-- | source/sv_mvd.c | 4 |
4 files changed, 7 insertions, 5 deletions
diff --git a/source/mvd_client.c b/source/mvd_client.c index 16cec3e..c19ca4d 100644 --- a/source/mvd_client.c +++ b/source/mvd_client.c @@ -182,7 +182,9 @@ void MVD_ClearState( mvd_t *mvd ) { mvd_player_t *player; int i; - memset( mvd->edicts, 0, sizeof( mvd->edicts[0] ) * mvd->pool.num_edicts ); + // clear all entities, don't trust num_edicts as it is possible + // to miscount removed entities + memset( mvd->edicts, 0, sizeof( mvd->edicts ) ); mvd->pool.num_edicts = 0; for( i = 0; i < mvd->maxclients; i++ ) { diff --git a/source/sv_ac.c b/source/sv_ac.c index cabb963..1d919f5 100644 --- a/source/sv_ac.c +++ b/source/sv_ac.c @@ -799,7 +799,7 @@ static void AC_ParseQueryReply( void ) { } if( cl->state < cs_connected || cl->state > cs_primed ) { - Com_DPrintf( "ANTICHEAT: %s with client in state %d\n", + Com_WPrintf( "ANTICHEAT: %s with client in state %d\n", __func__, cl->state ); SV_DropClient( cl, NULL ); return; diff --git a/source/sv_local.h b/source/sv_local.h index d2b9940..783f474 100644 --- a/source/sv_local.h +++ b/source/sv_local.h @@ -548,7 +548,7 @@ void SV_MvdMulticast( sizebuf_t *buf, int leafnum, mvd_ops_t op ); void SV_MvdConfigstring( int index, const char *string ); void SV_MvdBroadcastPrint( int level, const char *string ); void SV_MvdRecStop( void ); -qboolean SV_MvdPlayerIsActive( edict_t *ent ); +qboolean SV_MvdPlayerIsActive( const edict_t *ent ); void SV_MvdInitStream( void ); void SV_MvdGetStream( const char *uri ); void SV_MvdMapChanged( void ); diff --git a/source/sv_mvd.c b/source/sv_mvd.c index 11ab482..2cab403 100644 --- a/source/sv_mvd.c +++ b/source/sv_mvd.c @@ -61,7 +61,7 @@ whether given player is to be captured, instead of relying on this stupid and complex hack. ================== */ -qboolean SV_MvdPlayerIsActive( edict_t *ent ) { +qboolean SV_MvdPlayerIsActive( const edict_t *ent ) { int num; if( !ent->inuse ) { @@ -126,7 +126,7 @@ qboolean SV_MvdPlayerIsActive( edict_t *ent ) { return qtrue; } -static void SV_MvdCopyEntity( entity_state_t *dst, entity_state_t *src, int flags ) { +static void SV_MvdCopyEntity( entity_state_t *dst, const entity_state_t *src, int flags ) { if( !( flags & MSG_ES_FIRSTPERSON ) ) { VectorCopy( src->origin, dst->origin ); VectorCopy( src->angles, dst->angles ); |