Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.67k stars 326 forks source link

Fixed book mapping contributes not being detected on Windows #2637

Closed KABoissonneault closed 3 months ago

KABoissonneault commented 3 months ago

Fix for #2636.

Before #2580, we used to leave contributes untouched if no contributes were detected. Instead now, we always update contributes, removing files that are not detected by the function.

Detection of book mappings has always been broken on Windows. The path returned by Path.GetDirectoryName uses \ to separate paths, but the check for Books/Mapping checked with a forward slash.

I instead changed this function to properly detect the path Books/Mapping on any platform. As a result, the books should now properly be detected on Windows, and updating the mapping should always give the correct result.