Changeset 531 for trunk/AI/StdAI/ToolAI.pas
- Timestamp:
- Mar 27, 2024, 12:31:14 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/ToolAI.pas
r522 r531 355 355 UnitsToAssign: Boolean; 356 356 Adjacent: TVicinity8Loc; 357 SettlerOfJobLoc, DistToLoc: array[0..lxmax * lymax - 1] of smallint;357 SettlerOfJobLoc, DistToLoc: array[0..lxmax * lymax - 1] of SmallInt; 358 358 // DistToLoc is only defined where SettlerOfJobLoc>=0 359 359 TileChecked: array[0..lxmax * lymax - 1] of Boolean; … … 471 471 I, J, Loc, Loc1, V8, Count, Kind, MostIndex: Integer; 472 472 Adjacent: TVicinity8Loc; 473 IndexOfID: array[0..lxmax * lymax - 1] of smallint;474 IDOfIndex: array[0..lxmax * lymax div 2 - 1] of smallint;473 IndexOfID: array[0..lxmax * lymax - 1] of SmallInt; 474 IDOfIndex: array[0..lxmax * lymax div 2 - 1] of SmallInt; 475 475 begin 476 476 FillChar(District, MapSize * 4, $FF); … … 1107 1107 nSelectedLoad, F, OriginContinent, A, B: Integer; 1108 1108 CompleteFlag, NotReachedFlag, ContinueUnit: Cardinal; 1109 IsComplete, ok, IsFirstLoc: Boolean;1109 IsComplete, Ok, IsFirstLoc: Boolean; 1110 1110 StartLocPtr, ArrivedEnd: pinteger; 1111 1111 Adjacent: TVicinity8Loc; … … 1113 1113 tuixSelectedLoad: array[0..15] of Integer; 1114 1114 Arrived: array[0..lxmax * lymax] of Cardinal; 1115 ResponsibleTransport: array[0..lxmax * lymax - 1] of smallint;1115 ResponsibleTransport: array[0..lxmax * lymax - 1] of SmallInt; 1116 1116 TurnsBeforeLoad: array[0..lxmax * lymax - 1] of ShortInt; 1117 1117 GroupComplete: array[0..lxmax * lymax - 1] of Boolean; … … 1191 1191 FillChar(ResponsibleTransport, MapSize * 2, $FF); // -1 1192 1192 FillChar(TurnsBeforeLoad, MapSize, $FF); // -1 1193 ok := False;1193 Ok := False; 1194 1194 for uix := 0 to RO.nUn - 1 do 1195 1195 if TransportAvailable[uix] > 0 then 1196 1196 begin 1197 ok := True;1197 Ok := True; 1198 1198 Pile.Put(MyUnit[uix].Loc, ($800 - MyUnit[uix].Movement) shl 12 + uix); 1199 1199 end; 1200 if not ok then // no transports1200 if not Ok then // no transports 1201 1201 begin 1202 1202 TransportPlan.LoadLoc := -1; … … 1392 1392 begin 1393 1393 Arrived[Loc0] := (Arrived[Loc0] or CompleteFlag) and not NotReachedFlag; 1394 continue;1394 Continue; 1395 1395 end; 1396 1396 IsComplete := True; … … 1400 1400 if Loc1 >= 0 then 1401 1401 begin 1402 ok := False;1402 Ok := False; 1403 1403 case CheckStep(MoveStyle, Time0, V8 and 1, ArriveTime, 1404 1404 RecoverTurns, Map[Loc0], Map[Loc1], False) of 1405 csOk: ok := True;1405 csOk: Ok := True; 1406 1406 csForbiddenTile: 1407 1407 ;// !!! don't check moving there again 1408 1408 csCheckTerritory: 1409 ok := RO.Territory[Loc1] = RO.Territory[Loc0];1409 Ok := RO.Territory[Loc1] = RO.Territory[Loc0]; 1410 1410 end; 1411 if ok and Pile.TestPut(Loc1, ArriveTime) then1411 if Ok and Pile.TestPut(Loc1, ArriveTime) then 1412 1412 if ArriveTime < $2000 then 1413 1413 Pile.Put(Loc1, ArriveTime)
Note:
See TracChangeset
for help on using the changeset viewer.