From b02080d385ef053224a2628dde26f5a33da33cd8 Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 12 Jul 2003 14:57:20 +0000 Subject: [PATCH] added .ent file loading to client git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3256 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index a107d936..9190a9fb 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -214,9 +214,26 @@ void gl_main_shutdown(void) extern void CL_ParseEntityLump(char *entitystring); void gl_main_newmap(void) { - if (cl.worldmodel && cl.worldmodel->entities) - CL_ParseEntityLump(cl.worldmodel->entities); + int l; + char *entities, entname[MAX_QPATH]; r_framecount = 1; + if (cl.worldmodel) + { + strcpy(entname, cl.worldmodel->name); + l = strlen(entname) - 4; + if (l >= 0 && !strcmp(entname + l, ".bsp")) + { + strcpy(entname + l, ".ent"); + if ((entities = FS_LoadFile(entname, true))) + { + CL_ParseEntityLump(entities); + Mem_Free(entities); + return; + } + } + if (cl.worldmodel->entities) + CL_ParseEntityLump(cl.worldmodel->entities); + } } void GL_Main_Init(void) -- 2.39.2