]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added support for locs/something.loc naming in loc file loading code, for proquake...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Mar 2007 02:33:27 +0000 (02:33 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Mar 2007 02:33:27 +0000 (02:33 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6955 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
todo

index c70b63edac344951fe36a984306b658fe51f7cdd..66029ab8294beed4d31b9247709cb4a700a94817 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -1968,14 +1968,22 @@ void CL_Locs_Reload_f(void)
                Con_Printf("No level loaded!\n");
                return;
        }
-       FS_StripExtension(cl.worldmodel->name, locfilename, sizeof(locfilename));
-       strlcat(locfilename, ".loc", sizeof(locfilename));
 
        CL_Locs_Clear_f();
 
+       // try maps/something.loc first (LordHavoc: where I think they should be)
+       FS_StripExtension(cl.worldmodel->name, locfilename, sizeof(locfilename));
+       strlcat(locfilename, ".loc", sizeof(locfilename));
        filedata = (char *)FS_LoadFile(locfilename, cls.levelmempool, false, &filesize);
        if (!filedata)
-               return;
+       {
+               // try proquake name as well (LordHavoc: I hate path mangling)
+               FS_StripExtension(va("locs/%s", FS_FileWithoutPath(cl.worldmodel->name)), locfilename, sizeof(locfilename));
+               strlcat(locfilename, ".loc", sizeof(locfilename));
+               filedata = (char *)FS_LoadFile(locfilename, cls.levelmempool, false, &filesize);
+               if (!filedata)
+                       return;
+       }
        text = filedata;
        textend = filedata + filesize;
        for (linenumber = 1;text < textend;linenumber++)
diff --git a/todo b/todo
index a7c87869fbd281e8836c7be97c4ddd53879c3380..e04265806e84ebac7cf58bceeb80deef217d097d 100644 (file)
--- a/todo
+++ b/todo
 0 change hmap2: qbsp should do tjunc fixing on leaky maps
 0 change revelation: change the wabbit kill message to " was hunting wabbit but shot " " instead"
 0 change zmodel: include the example script in the build zips, not just in the files directory
-0 feature darkplaces client: add .loc file support and say macros
 0 feature darkplaces client: add .mvd demo support
 0 feature darkplaces client: add .qwd demo support
 0 feature darkplaces client: add DP_GFX_EFFECTINFO_TXT to extensions and document it, the feature has been in for a long time, also update wiki.quakesrc.org accordingly
@@ -1212,6 +1211,7 @@ d dpzoo.map: rain
 d dpzoo.map: skybox
 d dpzoo.map: snow
 d dpzoo.map: transparent glass bmodels (DP_ENT_ALPHA)
+d feature darkplaces client: add .loc file support and say macros
 d feature darkplaces client: add BX_WAL_SUPPORT to extensions and document it, the feature has been in for a long time, also update wiki.quakesrc.org accordingly
 d feature darkplaces client: add a sv_fixedframeratesingleplayer cvar (default off), to allow fixed framerate singleplayer mods, mainly useful for physics (Urre)
 d feature darkplaces client: add showbrand cvar which would show gfx/brand.tga in the left/right top/bottom corner (depending on value of scr_showbrand) all the time, this would be useful for screenshots (Spirit_of_85)