Changeset 457 for trunk/LocalPlayer/Enhance.pas
- Timestamp:
- Nov 27, 2023, 12:10:57 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Enhance.pas
r456 r457 128 128 I, stage, TerrType, TileImp, X, EndStage, Cost, LastJob: Integer; 129 129 S: string; 130 Done: Set of jNone .. jTrans;130 Done: set of jNone .. jTrans; 131 131 TypeChanged: Boolean; 132 132 begin … … 321 321 procedure TEnhanceDlg.JobClick(Sender: TObject); 322 322 var 323 stage, NewJob: Integer;323 Stage, NewJob: Integer; 324 324 Done: Set of jNone .. jTrans; 325 325 326 326 procedure RemoveJob(J: Integer); 327 327 begin // remove job 328 stage := 0;329 while ( stage < 5) and (MyData.EnhancementJobs[Page, stage] <> jNone) do330 begin 331 if (MyData.EnhancementJobs[Page, stage] = J) or (J = jRoad) and332 (MyData.EnhancementJobs[Page, stage] = jRR) or (J = jIrr) and333 (MyData.EnhancementJobs[Page, stage] = jFarm) then328 Stage := 0; 329 while (Stage < 5) and (MyData.EnhancementJobs[Page, Stage] <> jNone) do 330 begin 331 if (MyData.EnhancementJobs[Page, Stage] = J) or (J = jRoad) and 332 (MyData.EnhancementJobs[Page, Stage] = jRR) or (J = jIrr) and 333 (MyData.EnhancementJobs[Page, Stage] = jFarm) then 334 334 begin 335 if stage < 4 then336 Move(MyData.EnhancementJobs[Page, stage + 1],337 MyData.EnhancementJobs[Page, stage], 4 - stage);335 if Stage < 4 then 336 Move(MyData.EnhancementJobs[Page, Stage + 1], 337 MyData.EnhancementJobs[Page, Stage], 4 - Stage); 338 338 MyData.EnhancementJobs[Page, 4] := jNone; 339 339 end 340 340 else 341 Inc( stage);341 Inc(Stage); 342 342 end; 343 343 end; … … 346 346 NewJob := TButtonC(Sender).Tag; 347 347 Done := []; 348 stage := 0;349 while ( stage < 5) and (MyData.EnhancementJobs[Page, stage] <> jNone) do348 Stage := 0; 349 while (Stage < 5) and (MyData.EnhancementJobs[Page, Stage] <> jNone) do 350 350 begin 351 Include(Done, MyData.EnhancementJobs[Page, stage]);352 Inc( stage);351 Include(Done, MyData.EnhancementJobs[Page, Stage]); 352 Inc(Stage); 353 353 end; 354 354 if NewJob in Done then … … 362 362 if (NewJob = jRR) and not(jRoad in Done) then 363 363 begin 364 MyData.EnhancementJobs[Page, stage] := jRoad;365 Inc( stage);364 MyData.EnhancementJobs[Page, Stage] := jRoad; 365 Inc(Stage); 366 366 end; 367 367 if (NewJob = jFarm) and not(jIrr in Done) then 368 368 begin 369 MyData.EnhancementJobs[Page, stage] := jIrr;370 Inc( stage);371 end; 372 MyData.EnhancementJobs[Page, stage] := NewJob;369 MyData.EnhancementJobs[Page, Stage] := jIrr; 370 Inc(Stage); 371 end; 372 MyData.EnhancementJobs[Page, Stage] := NewJob; 373 373 end; 374 374 SmartUpdateContent;
Note:
See TracChangeset
for help on using the changeset viewer.