Skip to content

Commit

Permalink
update locality of function definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
chdoc committed Aug 14, 2024
1 parent ead9be7 commit e3e5438
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions idle-crafting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ local STONE_CRAFT = df.unit_labor['STONE_CRAFT']
---negative crafting focus penalty
---@param unit df.unit
---@return number
local function getCraftingNeed(unit)
function getCraftingNeed(unit)
local needs = unit.status.current_soul.personality.needs
for _, need in ipairs(needs) do
if need.id == CraftObject then
Expand Down Expand Up @@ -163,7 +163,7 @@ end
---unit is ready to take jobs
---@param unit df.unit
---@return boolean
local function unitIsAvailable(unit)
function unitIsAvailable(unit)
if unit.job.current_job then
return false
elseif #unit.social_activities > 0 then
Expand All @@ -184,7 +184,7 @@ end
---@param idx integer "index of the unit's group"
---@param unit_id integer
---@return boolean "proceed to next workshop"
function processUnit(workshop, idx, unit_id)
local function processUnit(workshop, idx, unit_id)
local unit = df.unit.find(unit_id)
-- check that unit is still there and not caged or chained
if not unit or unit.flags1.caged or unit.flags1.chained then
Expand Down Expand Up @@ -220,7 +220,7 @@ end

---@param workshop df.building_workshopst
---@return boolean
function invalidProfile(workshop)
local function invalidProfile(workshop)
local profile = workshop.profile
return (#profile.permitted_workers > 0) or
(profile.blocked_labors[BONE_CARVE] and profile.blocked_labors[STONE_CRAFT])
Expand Down

0 comments on commit e3e5438

Please sign in to comment.