Changeset 597 for trunk


Ignore:
Timestamp:
Aug 11, 2024, 9:50:17 PM (4 months ago)
Author:
chronos
Message:
  • Fixed: Do not select last map after saved random map from map editor.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r596 r597  
    144144    Translator: TTranslator;
    145145    procedure UpdateFormerGames;
    146     procedure UpdateMaps;
     146    procedure UpdateMaps(SelectLastMap: Boolean);
    147147  end;
    148148
     
    323323  MapFileName := '';
    324324  Maps := TStringList.Create;
    325   UpdateMaps;
     325  UpdateMaps(True);
    326326end;
    327327
     
    13091309end;
    13101310
    1311 procedure TStartDlg.UpdateMaps;
     1311procedure TStartDlg.UpdateMaps(SelectLastMap: Boolean);
    13121312var
    13131313  I: Integer;
     
    13221322  Maps.Sort;
    13231323  Maps.Insert(0, Phrases.Lookup('RANMAP'));
    1324   I := Maps.IndexOf(LastMap);
    1325   if I > 0 then begin // Skip random map on index 0
    1326     ListIndex[tbMap] := I;
    1327     MapFileName := GetMapsDir + DirectorySeparator + Maps[I] + CevoMapExt;
     1324  if SelectLastMap then begin
     1325    I := Maps.IndexOf(LastMap);
     1326    if I > 0 then begin // Skip random map on index 0
     1327      ListIndex[tbMap] := I;
     1328      MapFileName := GetMapsDir + DirectorySeparator + Maps[I] + CevoMapExt;
     1329    end else ListIndex[tbMap] := Maps.IndexOf(ExtractFileNameOnly(MapFileName));
    13281330  end else ListIndex[tbMap] := Maps.IndexOf(ExtractFileNameOnly(MapFileName));
    13291331  if ListIndex[tbMap] < 0 then
Note: See TracChangeset for help on using the changeset viewer.