Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
reyandme committed Feb 19, 2022
1 parent 18a4bc0 commit a766272
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/houses/KM_Houses.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ procedure TKMHouse.IncBuildingProgress;
Inc(fBuildingProgress, 5); //is how many effort was put into building nevermind applied damage
Dec(fBuildReserve, 5); //This is reserve we build from

if (fBuildState=hbsWood)
if (fBuildState = hbsWood)
and (fBuildingProgress = gResHouses[fType].WoodCost*50) then
fBuildState := hbsStone;

Expand Down Expand Up @@ -1562,7 +1562,7 @@ function TKMHouse.PickOrder: Byte;


// Check if house has enough resource supply to be built depending on it's state
function TKMHouse.CheckResToBuild:boolean;
function TKMHouse.CheckResToBuild: Boolean;
begin
case fBuildState of
hbsWood: Result := (fBuildSupplyWood > 0) or (fBuildReserve > 0);
Expand Down
4 changes: 2 additions & 2 deletions src/scripting/KM_ScriptingActions.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2441,8 +2441,8 @@ procedure TKMScriptActions.HouseAddBuildingProgress(aHouseID: Integer);
begin
H := fIDCache.GetHouse(aHouseID);
if H <> nil then
if (not H.IsComplete)
and (H.CheckResToBuild) then
if not H.IsComplete
and H.CheckResToBuild then
begin
H.IncBuildingProgress;
if H.IsStone
Expand Down
12 changes: 6 additions & 6 deletions src/units/tasks/KM_UnitTaskBuild.pas
Original file line number Diff line number Diff line change
Expand Up @@ -811,14 +811,14 @@ destructor TKMTaskBuildHouse.Destroy;
end;


{ If we are walking to the house but the house is destroyed/canceled we should abandon immediately
If house has not enough resource to be built, consider building task is done and look for a new
task that has enough resouces. Once this house has building resources delivered it will be
available from build queue again
If house is already built by other workers}
// If we are walking to the house but the house is destroyed/canceled we should abandon immediately
// If house has not enough resource to be built, consider building task is done and look for a new
// task that has enough resouces. Once this house has building resources delivered it will be
// available from build queue again
// If house is already built by other workers
function TKMTaskBuildHouse.WalkShouldAbandon: Boolean;
begin
Result := fHouse.IsDestroyed or (not fHouse.CheckResToBuild) or fHouse.IsComplete;
Result := fHouse.IsDestroyed or not fHouse.CheckResToBuild or fHouse.IsComplete;
end;


Expand Down

0 comments on commit a766272

Please sign in to comment.