Skip to content

Commit

Permalink
report on bad labors on squad units
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Jan 1, 2024
1 parent 295cf42 commit b9931ac
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions uniform-unstick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ local function bodyparts_that_can_wear(unit, item)
return bodyparts
end

local function print_bad_labor(unit_name, labor_name)
print("WARNING: Unit " .. unit_name .. " has the " .. labor_name ..
" labor enabled, which conflicts with military uniforms.")
end

-- Will figure out which items need to be moved to the floor, returns an item_id:item map
local function process(unit, args)
local silent = args.all -- Don't print details if we're iterating through all dwarves
Expand All @@ -100,6 +105,14 @@ local function process(unit, args)
return
end

if unit.status.labors.MINE then
print_bad_labor(unit_name, "mining")
elseif unit.status.labors.CUTWOOD then
print_bad_labor(unit_name, "woodcutting")
elseif unit.status.labors.HUNT then
print_bad_labor(unit_name, "hunting")
end

-- Find all worn items which may be at issue.
local worn_items = {} -- map of item ids to item objects
local worn_parts = {} -- map of item ids to body part ids
Expand Down

0 comments on commit b9931ac

Please sign in to comment.