Skip to content

Commit e0007a2

Browse files
committed
Load maps last, so files in them don't override game data.
Refs #2825.
1 parent 9d7e543 commit e0007a2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/init.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,8 @@ bool rebuildSearchPath( searchPathMode mode, bool force )
362362
#ifdef DEBUG
363363
debug(LOG_WZ, "Adding [%s] to search path", curSearchPath->path);
364364
#endif // DEBUG
365-
// Add maps and global and multiplay mods
365+
// Add global and multiplay mods
366366
PHYSFS_addToSearchPath( curSearchPath->path, PHYSFS_APPEND );
367-
addSubdirs( curSearchPath->path, "maps", PHYSFS_APPEND, NULL, false );
368367
addSubdirs( curSearchPath->path, "mods/music", PHYSFS_APPEND, NULL, false );
369368
addSubdirs( curSearchPath->path, "mods/global", PHYSFS_APPEND, use_override_mods?override_mods:global_mods, true );
370369
addSubdirs( curSearchPath->path, "mods", PHYSFS_APPEND, use_override_mods?override_mods:global_mods, true );
@@ -393,6 +392,15 @@ bool rebuildSearchPath( searchPathMode mode, bool force )
393392

394393
curSearchPath = curSearchPath->higherPriority;
395394
}
395+
curSearchPath = searchPathRegistry;
396+
while (curSearchPath->lowerPriority)
397+
curSearchPath = curSearchPath->lowerPriority;
398+
// Add maps last, so files in them don't override game data
399+
while (curSearchPath)
400+
{
401+
addSubdirs(curSearchPath->path, "maps", PHYSFS_APPEND, NULL, false);
402+
curSearchPath = curSearchPath->higherPriority;
403+
}
396404
break;
397405
default:
398406
debug(LOG_ERROR, "Can't switch to unknown mods %i", mode);

0 commit comments

Comments
 (0)