From a7662726006ad97cafbaaa6c8b3fc5cfc02c4ae7 Mon Sep 17 00:00:00 2001 From: Rey Date: Sun, 20 Feb 2022 00:00:40 +0200 Subject: [PATCH] Formatting --- src/houses/KM_Houses.pas | 4 ++-- src/scripting/KM_ScriptingActions.pas | 4 ++-- src/units/tasks/KM_UnitTaskBuild.pas | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/houses/KM_Houses.pas b/src/houses/KM_Houses.pas index ddfd0f8f71..a7838ea21c 100644 --- a/src/houses/KM_Houses.pas +++ b/src/houses/KM_Houses.pas @@ -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; @@ -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); diff --git a/src/scripting/KM_ScriptingActions.pas b/src/scripting/KM_ScriptingActions.pas index 507290908a..ca9dc9b2d2 100644 --- a/src/scripting/KM_ScriptingActions.pas +++ b/src/scripting/KM_ScriptingActions.pas @@ -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 diff --git a/src/units/tasks/KM_UnitTaskBuild.pas b/src/units/tasks/KM_UnitTaskBuild.pas index 962b73a402..8c1743cb69 100644 --- a/src/units/tasks/KM_UnitTaskBuild.pas +++ b/src/units/tasks/KM_UnitTaskBuild.pas @@ -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;