@@ -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