- Timestamp:
- Aug 10, 2024, 3:40:04 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI Template/AI.pas
r582 r592 185 185 begin // tile is exploited, but not the city own tile -- check if improvable 186 186 RadiusLoc := Radius[V21]; 187 assert((RadiusLoc >= 0) and (RadiusLoc < MapSize));187 Assert((RadiusLoc >= 0) and (RadiusLoc < MapSize)); 188 188 if (RadiusLoc >= 0) and (RadiusLoc < MapSize) then 189 189 begin -
trunk/AI Template/CustomAI.pas
r583 r592 687 687 Result := True; 688 688 // always returns true so that it can be used like 689 // " assert(DebugMessage(...));" -> not compiled in release build689 // "Assert(DebugMessage(...));" -> not compiled in release build 690 690 end; 691 691 … … 696 696 Result := True; 697 697 // always returns true so that it can be used like 698 // " assert(SetDebugMap(...));" -> not compiled in release build698 // "Assert(SetDebugMap(...));" -> not compiled in release build 699 699 end; 700 700 -
trunk/AI Template/ToolAI.pas
r582 r592 293 293 procedure TToolAI.JobAssignment_AddUnit(uix: integer); 294 294 begin 295 assert(MyModel[MyUnit[uix].mix].Kind in [mkSettler, mkSlaves]);295 Assert(MyModel[MyUnit[uix].mix].Kind in [mkSettler, mkSlaves]); 296 296 JobLocOfSettler[uix] := ToAssign; 297 297 end; … … 598 598 MoveCost, RecoverCost: integer; 599 599 begin 600 assert(((FromTile and fTerrain <= fMountains) or (FromTile and fTerrain = fUNKNOWN)) and600 Assert(((FromTile and fTerrain <= fMountains) or (FromTile and fTerrain = fUNKNOWN)) and 601 601 ((ToTile and fTerrain <= fMountains) or (ToTile and fTerrain = fUNKNOWN))); 602 602 // do not pass location codes for FromTile and ToTile! … … 775 775 end 776 776 777 else {if MoveStyle <msSpy+$10000000 then}777 else {if MoveStyle < msSpy + $10000000 then} 778 778 begin // spies 779 779 if (ToTile + 1) and fTerrain < fGrass + 1 then … … 834 834 // todo: check exit condition, e.g. whether destination reached 835 835 836 Reached[Loc]:= true;836 Reached[Loc]:=True; 837 837 V8_to_Loc(Loc, Adjacent); 838 838 for V8:=0 to 7 do … … 844 844 Pile.Put(NextLoc, NextTime+RecoverTurns*$1000); 845 845 csForbiddenTile: 846 Reached[NextLoc]:= true; // don't check moving there again846 Reached[NextLoc]:=True; // don't check moving there again 847 847 csCheckTerritory: 848 848 if RO.Territory[NextLoc]=RO.Territory[Loc] then … … 954 954 i: integer; 955 955 begin 956 assert(not InitComplete); // call order violation!956 Assert(not InitComplete); // call order violation! 957 957 if Map[MyUnit[uix].Loc] and fTerrain < fGrass then exit; 958 958 for i := 0 to nTransportLoad - 1 do 959 if uix = uixTransportLoad[i] then exit;959 if uix = uixTransportLoad[i] then Exit; 960 960 uixTransportLoad[nTransportLoad] := uix; 961 961 Inc(nTransportLoad); … … 966 966 MoveStyle: integer; 967 967 begin 968 assert(not InitComplete); // call order violation!969 assert(MyModel[MyUnit[uix].mix].Cap[mcSeaTrans] > 0);968 Assert(not InitComplete); // call order violation! 969 Assert(MyModel[MyUnit[uix].mix].Cap[mcSeaTrans] > 0); 970 970 TransportAvailable[uix] := 1; 971 971 with MyModel[MyUnit[uix].mix] do … … 983 983 procedure TToolAI.SeaTransport_AddDestination(Loc: integer); 984 984 begin 985 assert(not InitComplete); // call order violation!985 Assert(not InitComplete); // call order violation! 986 986 Pile.Put(Loc, $800); 987 987 HaveDestinations := True; … … 993 993 Adjacent: TVicinity8Loc; 994 994 begin 995 assert(not InitComplete); // call order violation!995 Assert(not InitComplete); // call order violation! 996 996 InitComplete := True; 997 997 if HaveDestinations then … … 1040 1040 GroupComplete: array[0..lxmax * lymax - 1] of boolean; 1041 1041 begin 1042 assert(InitComplete); // call order violation!1042 Assert(InitComplete); // call order violation! 1043 1043 1044 1044 if HaveDestinations and (nTransportLoad > 0) then … … 1054 1054 if (abs(a) <= 1) and (abs(b) <= 1) then 1055 1055 begin 1056 assert((a <> 0) or (b <> 0));1056 Assert((a <> 0) or (b <> 0)); 1057 1057 Inc(GroupCount); 1058 1058 end; … … 1090 1090 for tuix := 0 to nTransportLoad - 1 do 1091 1091 begin 1092 assert(Map[MyUnit[uixTransportLoad[tuix]].Loc] and fTerrain >= fGrass);1092 Assert(Map[MyUnit[uixTransportLoad[tuix]].Loc] and fTerrain >= fGrass); 1093 1093 f := Formation[MyUnit[uixTransportLoad[tuix]].Loc]; 1094 1094 if f >= 0 then Inc(Arrived[f]); -
trunk/AI/StdAI/AI.pas
r549 r592 289 289 end; 290 290 end; 291 //!!! assert(Quality>0);291 //!!!Assert(Quality > 0); 292 292 end; 293 293 -
trunk/AI/StdAI/CustomAI.pas
r531 r592 687 687 Result := True; 688 688 // always returns true so that it can be used like 689 // " assert(DebugMessage(...));" -> not compiled in release build689 // "Assert(DebugMessage(...));" -> not compiled in release build 690 690 end; 691 691 … … 696 696 Result := True; 697 697 // always returns true so that it can be used like 698 // " assert(SetDebugMap(...));" -> not compiled in release build698 // "Assert(SetDebugMap(...));" -> not compiled in release build 699 699 end; 700 700 -
trunk/AI/StdAI/StdAI.lpi
r289 r592 2 2 <CONFIG> 3 3 <ProjectOptions> 4 <Version Value="1 1"/>4 <Version Value="12"/> 5 5 <PathDelim Value="\"/> 6 6 <General> … … 9 9 <MainUnitHasCreateFormStatements Value="False"/> 10 10 <MainUnitHasTitleStatement Value="False"/> 11 <MainUnitHasScaledStatement Value="False"/> 12 <CompatibilityMode Value="True"/> 11 13 </Flags> 12 14 <SessionStorage Value="InProjectDir"/> 13 <MainUnit Value="0"/>14 15 <Title Value="StdAI"/> 15 16 <UseAppBundle Value="False"/> … … 40 41 </SyntaxOptions> 41 42 </Parsing> 42 <CodeGeneration>43 <Optimizations>44 <OptimizationLevel Value="3"/>45 </Optimizations>46 </CodeGeneration>47 43 <Linking> 48 44 <Debugging> … … 69 65 <RunParams> 70 66 <FormatVersion Value="2"/> 71 <Modes Count="0"/>72 67 </RunParams> 73 68 <RequiredPackages Count="1"> -
trunk/AI/StdAI/ToolAI.pas
r548 r592 652 652 MoveCost, RecoverCost: Integer; 653 653 begin 654 //IsCapture :=true;654 //IsCapture := True; 655 655 Assert(((FromTile and fTerrain <= fMountains) or (FromTile and 656 656 fTerrain = fUNKNOWN)) and ((ToTile and fTerrain <= fMountains) or -
trunk/Brain.pas
r589 r592 84 84 with Picture.Canvas do begin 85 85 Brush.Color := $904830; 86 FillRect(Rect(0, 0, 64, 64));86 FillRect(Rect(0, 0, Picture.Width, Picture.Height)); 87 87 Font.Assign(UniFont[ftTiny]); 88 88 Font.Style := []; 89 89 Font.Color := $5FDBFF; 90 90 TextSize := TextExtent(FileName); 91 TextOut(32 - TextSize.Width div 2, 32 - TextSize.Height div 2, FileName); 91 TextOut((Picture.Width - TextSize.Width) div 2, 92 (Picture.Height - TextSize.Height) div 2, FileName); 92 93 end; 93 94 end; … … 110 111 Flags := fMultiple; 111 112 Client := nil; 112 Initialized := false;113 Initialized := False; 113 114 ServerVersion := 0; 114 115 if not FileExists(AIFileName) then … … 118 119 while not EOF(T) do 119 120 begin 120 ReadLn(T, s);121 s := trim(s);121 ReadLn(T, S); 122 S := Trim(s); 122 123 if Pos(' ', S) > 0 then begin 123 124 Key := Copy(S, 1, Pos(' ', S) - 1); … … 160 161 {$ENDIF}{$ENDIF} 161 162 else if Key = '#GAMEVERSION' then 162 for i:= 1 to Length(Value) do163 case Value[ i] of163 for I := 1 to Length(Value) do 164 case Value[I] of 164 165 '0' .. '9': 165 166 ServerVersion := ServerVersion and $FFFF00 + ServerVersion and 166 $FF * 10 + ord(Value[i]) - 48;167 $FF * 10 + Ord(Value[I]) - 48; 167 168 '.': 168 169 ServerVersion := ServerVersion shl 8; -
trunk/Database.pas
r591 r592 2283 2283 Exit; 2284 2284 IntServer(sIntTellAboutNation, p1, p2, nil^); 2285 // NewContact[p1, p2]:=true2285 // NewContact[p1, p2] := True 2286 2286 end; 2287 2287 -
trunk/GameServer.pas
r591 r592 331 331 NullOffer.nCost := 0; 332 332 Server(scDipOffer, pDipActive, 0, NullOffer); 333 end 334 end 333 end; 334 end; 335 335 end; 336 336 … … 1031 1031 with RW[pTurn].City[cix] do 1032 1032 if Loc >= 0 then begin 1033 // if SavedResourceWeights[cix] <> ResourceWeights then Result := true;1033 // if SavedResourceWeights[cix] <> ResourceWeights then Result := True; 1034 1034 if SavedTiles[cix] <> Tiles then begin 1035 1035 Result := True; -
trunk/LocalPlayer/CityScreen.pas
r550 r592 1472 1472 IconKind := mikImp; 1473 1473 IconIndex := NewProject and cpIndex; 1474 Gtk2Fix; 1474 1475 ShowModal; 1475 1476 QueryOk := ModalResult = mrOK; … … 1512 1513 (MyCity[cix].Size < 3) and 1513 1514 ((MyModel[NewProject and cpIndex].Kind = mkSlaves) or 1514 (NewProject and cpConscripts <> 0))) then 1515 if SimpleQuery(mkYesNo, Phrases.Lookup('EMIGRATE'), 'MSG_DEFAULT') <> mrOK 1516 then 1517 NewProject := NewProject or cpDisbandCity; 1515 (NewProject and cpConscripts <> 0))) then begin 1516 Gtk2Fix; 1517 if SimpleQuery(mkYesNo, Phrases.Lookup('EMIGRATE'), 'MSG_DEFAULT') <> mrOK then 1518 NewProject := NewProject or cpDisbandCity; 1519 end; 1518 1520 Server(sSetCityProject, Me, cix, NewProject); 1519 1521 C.Project := MyCity[cix].Project; -
trunk/LocalPlayer/ClientTools.pas
r549 r592 601 601 // TODO: What is this assert for? 602 602 // Need to optimize city tiles but CheckOnly true? 603 // assert(false)603 //Assert(false) 604 604 end 605 605 else -
trunk/LocalPlayer/Nego.pas
r558 r592 875 875 InputDlg.EditInput.Text := ''; 876 876 InputDlg.CenterToRect(BoundsRect); 877 Gtk2Fix; 877 878 InputDlg.ShowModal; 878 879 if InputDlg.ModalResult <> mrOK then -
trunk/LocalPlayer/Term.pas
r580 r592 7573 7573 or (MyRO.TestFlags and (tfAllTechs or tfUncover or tfAllContact) <> 0); 7574 7574 mEUnitStat.Enabled := MyRO.nEnemyModel > 0; 7575 { mWonders.Enabled:= false;7576 for I :=0 to nWonder - 1 do if MyRO.Wonder[I].CityID <> WonderNotBuiltYet then7577 mWonders.Enabled :=True; }7575 { mWonders.Enabled:= False; 7576 for I := 0 to nWonder - 1 do if MyRO.Wonder[I].CityID <> WonderNotBuiltYet then 7577 mWonders.Enabled := True; } 7578 7578 mDiagram.Enabled := MyRO.Turn >= 2; 7579 7579 mShips.Enabled := False; -
trunk/Packages/Common/StopWatch.pas
r456 r592 22 22 function GetElapsed: string; 23 23 public 24 constructor Create(const startOnCreate 24 constructor Create(const startOnCreate: Boolean = False) ; 25 25 procedure Start; 26 26 procedure Stop; … … 35 35 implementation 36 36 37 constructor TStopWatch.Create(const startOnCreate : boolean = false) ;37 constructor TStopWatch.Create(const startOnCreate: Boolean = False) ; 38 38 begin 39 39 inherited Create; -
trunk/Packages/DpiControls/Dpi.StdCtrls.pas
r568 r592 158 158 property ItemHeight: Integer read GetItemHeight write SetItemHeight; 159 159 property IntegralHeight: Boolean read GetIntegralHeight write SetIntegralHeight default False; 160 property ExtendedSelect: Boolean read GetExtendedSelect write SetExtendedSelect default true;160 property ExtendedSelect: Boolean read GetExtendedSelect write SetExtendedSelect default True; 161 161 property BorderStyle: TBorderStyle read GetBorderStyle write SetBorderStyle default bsNone; 162 162 property Visible;
Note:
See TracChangeset
for help on using the changeset viewer.