This repository was archived by the owner on Aug 21, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,7 @@ TFSManager = class (TComponent,IResourceLoader)
317317 procedure ProcessFSConfig (AConfig: TFilesystemConfig; ARootPath: TStrings);
318318
319319 procedure LoadFSConfig ;
320+ procedure GenerateGamepath ;
320321 procedure ScanFilesystem ;
321322
322323 procedure AddModPathsTo (sl:TStrings);
@@ -892,6 +893,25 @@ procedure TFSManager.LoadFSConfig;
892893 end ;
893894end ;
894895
896+ procedure TFSManager.GenerateGamepath ;
897+ { $IFDEF WIN32}
898+ var
899+ s: String;
900+ { $ENDIF}
901+ begin
902+ FGamePath.Append(ExtractFilePath(ParamStr(0 )));
903+ { $IFDEF WIN32}
904+
905+ s:= GetEnvironmentVariable(' HOMEDRIVE' ) + GetEnvironmentVariable(' HOMEPATH' );
906+
907+ s := IncludeTrailingPathDelimiter(s);
908+
909+ FGamePath.Append(s + ' Documents\My Games\vcmi' );
910+
911+ { $ENDIF}
912+
913+ end ;
914+
895915procedure TFSManager.LoadGameConfig ;
896916var
897917 res: TJsonResource;
@@ -1424,15 +1444,14 @@ procedure TFSManager.ScanFilesystem;
14241444var
14251445 s: String;
14261446 i: Integer;
1427-
14281447begin
1429- s := GetPrivateConfigPath +GAME_PATH_CONFIG;
1448+ s := ExtractFilePath(ParamStr( 0 )) +GAME_PATH_CONFIG;
14301449 if FileExistsUTF8(s) then
14311450 begin
14321451 FGamePath.LoadFromFile(s);
14331452 end
14341453 else begin
1435- FGamePath.Append(ExtractFilePath(ParamStr( 0 ))) ;
1454+ GenerateGamepath ;
14361455 end ;
14371456
14381457 for i := 0 to FGamePath.Count - 1 do
You can’t perform that action at this time.
0 commit comments