Skip to content

Commit 6add95f

Browse files
committed
clean up conflict report
remove non-conflict lines
1 parent ccb2bd7 commit 6add95f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

docs/uniform-unstick.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ item for that bodypart (e.g. if you're still manufacturing them).
1919

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

22+
When generating a report of conflicts, items that simply haven't been picked up
23+
yet or uniform components that haven't been assigned by DF are not considered
24+
conflicts and are not included in the report.
25+
2226
Usage
2327
-----
2428

uniform-unstick.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,12 @@ local function process(unit, args, need_newline)
163163
local missing_ids = {} -- map of item ID to item object
164164
for u_id, item in pairs(assigned_items) do
165165
if not worn_items[u_id] then
166-
need_newline = print_line(unit_name .. " is missing an assigned item, object #" .. u_id .. " '" ..
167-
item_description(item) .. "'", need_newline)
166+
if not silent then
167+
need_newline = print_line(unit_name .. " is missing an assigned item, object #" .. u_id .. " '" ..
168+
item_description(item) .. "'", need_newline)
169+
end
168170
if dfhack.items.getGeneralRef(item, df.general_ref_type.UNIT_HOLDER) then
169-
print(" Another unit has a claim on object #" .. u_id .. " '" .. item_description(item) .. "'")
171+
need_newline = print_line(unit_name .. " cannot equip item: another unit has a claim on object #" .. u_id .. " '" .. item_description(item) .. "'", need_newline)
170172
if args.free then
171173
print(" Removing from uniform")
172174
assigned_items[u_id] = nil
@@ -220,8 +222,7 @@ local function process(unit, args, need_newline)
220222
for w_id, item in pairs(worn_items) do
221223
if assigned_items[w_id] == nil then -- don't drop uniform pieces (including shields, weapons for hands)
222224
if uncovered[worn_parts[w_id]] then
223-
need_newline = print_line("Unit " ..
224-
unit_name ..
225+
need_newline = print_line(unit_name ..
225226
" potentially has object #" ..
226227
w_id .. " '" .. item_description(item) .. "' blocking a missing uniform item.", need_newline)
227228
if args.drop then

0 commit comments

Comments
 (0)