Ignore:
Timestamp:
Mar 8, 2021, 10:11:47 PM (4 years ago)
Author:
chronos
Message:
  • Modified: CevoTribeExt string defined on single place.
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r295 r301  
    786786function CreateTribe(p: integer; FileName: string; Original: boolean): boolean;
    787787begin
    788   if not FileExists(LocalizedFilePath('Tribes' + DirectorySeparator + FileName +
    789     '.tribe.txt')) then
    790   begin
    791     result := false;
    792     exit
     788  FileName := LocalizedFilePath('Tribes' + DirectorySeparator + FileName +
     789    CevoTribeExt);
     790  if not FileExists(FileName) then
     791  begin
     792    Result := False;
     793    Exit;
    793794  end;
    794795
     
    14131414begin
    14141415  UnusedTribeFiles.Clear;
    1415   ok := FindFirst(LocalizedFilePath('Tribes') + DirectorySeparator + '*.tribe.txt',
     1416  ok := FindFirst(LocalizedFilePath('Tribes') + DirectorySeparator + '*' + CevoTribeExt,
    14161417    faArchive + faReadOnly, SearchRec) = 0;
    14171418  if not ok then
    14181419  begin
    14191420    FindClose(SearchRec);
    1420     ok := FindFirst(LocalizedFilePath('Tribes' + DirectorySeparator + '*.tribe.txt'),
     1421    ok := FindFirst(LocalizedFilePath('Tribes' + DirectorySeparator + '*' + CevoTribeExt),
    14211422      faArchive + faReadOnly, SearchRec) = 0;
    14221423  end;
    14231424  if ok then
    14241425    repeat
    1425       SearchRec.Name := Copy(SearchRec.Name, 1, Length(SearchRec.Name) - 10);
     1426      SearchRec.Name := Copy(SearchRec.Name, 1, Length(SearchRec.Name) - Length(CevoTribeExt));
    14261427      if GetTribeInfo(SearchRec.Name, Name, Color) then
    14271428        UnusedTribeFiles.AddObject(SearchRec.Name, TObject(Color));
     
    14321433function TMainScreen.ChooseUnusedTribe: integer;
    14331434var
    1434   i, j, ColorDistance, BestColorDistance, TestColorDistance,
    1435     CountBest: integer;
     1435  i: Integer;
     1436  j: Integer;
     1437  ColorDistance: Integer;
     1438  BestColorDistance: Integer;
     1439  TestColorDistance: Integer;
     1440  CountBest: Integer;
    14361441begin
    14371442  assert(UnusedTribeFiles.Count > 0);
Note: See TracChangeset for help on using the changeset viewer.