ensure that ent->classname is always non-null (for entity numbers up to level.num_entities-1, and ENTITYNUM_WORLD and ENTITYNUM_NONE), for player entities and #ENTITYNUM_NONE in particular, patch by DevHC

This commit is contained in:
Thilo Schulz 2011-05-14 14:34:18 +00:00
parent 4b9ab42c2c
commit 30059eb8ce
4 changed files with 341 additions and 79 deletions

View file

@ -466,6 +466,10 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
// range are NEVER anything but clients
level.num_entities = MAX_CLIENTS;
for ( i=0 ; i<MAX_CLIENTS ; i++ ) {
g_entities[i].classname = "clientslot";
}
// let the server system know where the entites are
trap_LocateGameData( level.gentities, level.num_entities, sizeof( gentity_t ),
&level.clients[0].ps, sizeof( level.clients[0] ) );