File: fs_search_order.patch

package info (click to toggle)
quakespasm 0.93.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,672 kB
  • sloc: ansic: 52,034; sh: 306; makefile: 263
file content (35 lines) | stat: -rw-r--r-- 1,155 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
allow plain files to override files inside a PAK file -- Sander van Dijk.

Index: Quake/common.c
===================================================================
--- Quake/common.c	(revision 1476)
+++ Quake/common.c	(working copy)
@@ -2036,13 +2036,6 @@ static void COM_AddGameDirectory (const 
 	else	path_id = 1U;
 
 _add_path:
-	// add the directory to the search path
-	search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
-	search->path_id = path_id;
-	q_strlcpy (search->filename, com_gamedir, sizeof(search->filename));
-	search->next = com_searchpaths;
-	com_searchpaths = search;
-
 	// add any pak files in the format pak0.pak pak1.pak, ...
 	for (i = 0; ; i++)
 	{
@@ -2074,6 +2067,13 @@ _add_path:
 		if (!pak) break;
 	}
 
+	// add the directory to the search path -- moved here from before the pakX.pak loop -- svdijk.
+	search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
+	search->path_id = path_id;
+	q_strlcpy (search->filename, com_gamedir, sizeof(search->filename));
+	search->next = com_searchpaths;
+	com_searchpaths = search;
+
 	if (!been_here && host_parms->userdir != host_parms->basedir)
 	{
 		been_here = true;