]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
added .ent file loading to client
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 12 Jul 2003 14:57:20 +0000 (14:57 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 12 Jul 2003 14:57:20 +0000 (14:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3256 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index a107d9362550142f4701d3e241f51eb6de064dc8..9190a9fb17e5a4a7d8e8b3668290629ceaa6e363 100644 (file)
@@ -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)