summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2014-07-13 16:54:02 +0200
committer/dev/humancontroller <devhc@example.com>2017-03-09 13:51:10 +0100
commit293969ceba8548db4f26807a5727aac916f1b774 (patch)
tree0e5196e07d9ffb5b301c916aec9f22b5ce856ead /src/game/g_main.c
parent26679919179daee5a72c1cd900d54338b5d72efe (diff)
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
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index efc33a1d..d0e687a8 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -616,6 +616,9 @@ 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 ] ) );