File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed
src/UnturnedRedistUpdateTool Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -156,25 +156,13 @@ void AssertPlatformSupported()
156156
157157 string GetUnturnedDataDirectoryName ( )
158158 {
159- if ( linux )
160- {
161- const string linuxUnturnedDataDirectoryName = "Unturned_Headless_Data" ;
162- var headless = Path . Combine ( unturnedPath , linuxUnturnedDataDirectoryName ) ;
163- if ( Directory . Exists ( headless ) )
164- {
165- return headless ;
166- }
167- }
168- else if ( windows )
169- {
170- const string windowsUnturnedDataDirectoryName = "Unturned_Data" ;
171- var usual = Path . Combine ( unturnedPath , windowsUnturnedDataDirectoryName ) ;
172- if ( Directory . Exists ( usual ) )
173- {
174- return usual ;
175- }
176- }
177- throw new DirectoryNotFoundException ( $ "Unturned Data directory cannot be found in { unturnedPath } ") ;
159+ string [ ] possiblePath =
160+ [
161+ Path . Combine ( unturnedPath , "Unturned_Headless_Data" ) ,
162+ Path . Combine ( unturnedPath , "Unturned_Data" )
163+ ] ;
164+ return possiblePath . FirstOrDefault ( Directory . Exists )
165+ ?? throw new DirectoryNotFoundException ( $ "Unturned Data directory cannot be found in { unturnedPath } ") ;
178166 }
179167 }
180168
You can’t perform that action at this time.
0 commit comments