Skip to content
Browse files

Load maps last, so files in them don't override game data.

Refs #2825.
  • Loading branch information...
1 parent ca7d25f commit 1838d20c1db487f3e03a5cf8e0f4f3a668b20a5c @cybersphinx cybersphinx committed
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/init.c
View
12 src/init.c
@@ -359,9 +359,8 @@ BOOL rebuildSearchPath( searchPathMode mode, BOOL force )
#ifdef DEBUG
debug(LOG_WZ, "Adding [%s] to search path", curSearchPath->path);
#endif // DEBUG
- // Add maps and global and multiplay mods
+ // Add global and multiplay mods
PHYSFS_addToSearchPath( curSearchPath->path, PHYSFS_APPEND );
- addSubdirs( curSearchPath->path, "maps", PHYSFS_APPEND, NULL, false );
addSubdirs( curSearchPath->path, "mods/music", PHYSFS_APPEND, NULL, false );
addSubdirs( curSearchPath->path, "mods/global", PHYSFS_APPEND, use_override_mods?override_mods:global_mods, true );
addSubdirs( curSearchPath->path, "mods", PHYSFS_APPEND, use_override_mods?override_mods:global_mods, true );
@@ -390,6 +389,15 @@ BOOL rebuildSearchPath( searchPathMode mode, BOOL force )
curSearchPath = curSearchPath->higherPriority;
}
+ curSearchPath = searchPathRegistry;
+ while (curSearchPath->lowerPriority)
+ curSearchPath = curSearchPath->lowerPriority;
+ // Add maps last, so files in them don't override game data
+ while (curSearchPath)
+ {
+ addSubdirs(curSearchPath->path, "maps", PHYSFS_APPEND, NULL, false);
+ curSearchPath = curSearchPath->higherPriority;
+ }
break;
default:
debug(LOG_ERROR, "Can't switch to unknown mods %i", mode);

0 comments on commit 1838d20

Please sign in to comment.
Something went wrong with that request. Please try again.