Changeset 592 for trunk/AI Template/ToolAI.pas
- Timestamp:
- Aug 10, 2024, 3:40:04 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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]);
Note:
See TracChangeset
for help on using the changeset viewer.