summaryrefslogtreecommitdiff
path: root/source/mvd_client.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-09-29 21:41:24 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-09-29 21:41:24 +0000
commit5b1969053745b8c29e0044953b744d5759c0bccd (patch)
tree1fda58b4d335677c00e87eca0733c3af12f95462 /source/mvd_client.c
parent0da4cda7cf1a19b17c195a043880b0d0d1993c2e (diff)
Ensure MVD client clears all entities when changing levels.
Diffstat (limited to 'source/mvd_client.c')
-rw-r--r--source/mvd_client.c4
1 files changed, 3 insertions, 1 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++ ) {