Changeset 614 for trunk/GameServer.pas


Ignore:
Timestamp:
Sep 14, 2024, 5:43:37 PM (2 months ago)
Author:
chronos
Message:
  • Added: Nwe editor menu action to create filled map with selected tile.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GameServer.pas

    r604 r614  
    7575  MovieMode: Boolean): Boolean;
    7676procedure EditMap(const AMapFileName: string; Newlx, Newly, NewLandMass: Integer);
     77procedure FillMap(TerrainType: Cardinal);
    7778procedure DirectHelp(Command: Integer);
    7879function ToAutoSaveFileName(FileName: string): string;
     
    13631364  Notify(ntBackOff);
    13641365  Inform(pTurn);
    1365   ChangeClientWhenDone(cTurn, 0, nil^, 0)
     1366  ChangeClientWhenDone(cTurn, 0, nil^, 0);
     1367end;
     1368
     1369procedure FillMap(TerrainType: Cardinal);
     1370var
     1371  Loc1: Integer;
     1372begin
     1373  for Loc1 := 0 to MapSize - 1 do
     1374    RealMap[Loc1] := TerrainType or ($F shl 27);
    13661375end;
    13671376
     
    13751384procedure EditMap(const AMapFileName: string; Newlx, Newly, NewLandMass: Integer);
    13761385var
    1377   p1, Loc1: Integer;
     1386  p1: Integer;
    13781387  Game: TNewGameData;
    13791388  Map: TMap;
     
    14021411    FreeAndNil(Map);
    14031412  end else begin
    1404     for Loc1 := 0 to MapSize - 1 do
    1405       RealMap[Loc1] := fOcean or ($F shl 27);
     1413    FillMap(fOcean);
    14061414  end;
    14071415  CL := nil;
     
    30693077
    30703078    sRandomMap:
    3071       if (Player = 0) and MapGeneratorAvailable then
    3072       begin
     3079      if (Player = 0) and MapGeneratorAvailable then begin
    30733080        CreateElevation;
    30743081        PreviewElevation := False;
     
    30763083        FillChar(ObserveLevel, MapSize * 4, 0);
    30773084        DiscoverAll(Player, lObserveSuper);
    3078       end
    3079       else
    3080         Result := eInvalid;
     3085      end else Result := eInvalid;
     3086
     3087    sFillMap:
     3088      if Player = 0 then begin
     3089        FillMap(TFillMapData(Data).Tile);
     3090        FillChar(ObserveLevel, MapSize * 4, 0);
     3091        DiscoverAll(Player, lObserveSuper);
     3092      end else Result := eInvalid;
    30813093
    30823094    sMapGeneratorRequest:
Note: See TracChangeset for help on using the changeset viewer.