Skip to content

Commit

Permalink
clean up conflict report
Browse files Browse the repository at this point in the history
remove non-conflict lines
  • Loading branch information
myk002 committed Jan 24, 2024
1 parent ccb2bd7 commit 6add95f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/uniform-unstick.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ item for that bodypart (e.g. if you're still manufacturing them).

Uniforms that have no issues are being properly worn will not be affected.

When generating a report of conflicts, items that simply haven't been picked up
yet or uniform components that haven't been assigned by DF are not considered
conflicts and are not included in the report.

Usage
-----

Expand Down
11 changes: 6 additions & 5 deletions uniform-unstick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ local function process(unit, args, need_newline)
local missing_ids = {} -- map of item ID to item object
for u_id, item in pairs(assigned_items) do
if not worn_items[u_id] then
need_newline = print_line(unit_name .. " is missing an assigned item, object #" .. u_id .. " '" ..
item_description(item) .. "'", need_newline)
if not silent then
need_newline = print_line(unit_name .. " is missing an assigned item, object #" .. u_id .. " '" ..
item_description(item) .. "'", need_newline)
end
if dfhack.items.getGeneralRef(item, df.general_ref_type.UNIT_HOLDER) then
print(" Another unit has a claim on object #" .. u_id .. " '" .. item_description(item) .. "'")
need_newline = print_line(unit_name .. " cannot equip item: another unit has a claim on object #" .. u_id .. " '" .. item_description(item) .. "'", need_newline)
if args.free then
print(" Removing from uniform")
assigned_items[u_id] = nil
Expand Down Expand Up @@ -220,8 +222,7 @@ local function process(unit, args, need_newline)
for w_id, item in pairs(worn_items) do
if assigned_items[w_id] == nil then -- don't drop uniform pieces (including shields, weapons for hands)
if uncovered[worn_parts[w_id]] then
need_newline = print_line("Unit " ..
unit_name ..
need_newline = print_line(unit_name ..
" potentially has object #" ..
w_id .. " '" .. item_description(item) .. "' blocking a missing uniform item.", need_newline)
if args.drop then
Expand Down

0 comments on commit 6add95f

Please sign in to comment.