Skip to content

Commit de12a18

Browse files
committed
internal/caravan/pedestal.lua use new obfuscate_value() API
Verified that this gives identical results to the unmodified code.
1 parent 761a677 commit de12a18

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/caravan/pedestal.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,10 @@ local function get_status(item, display_bld)
503503
return STATUS.AVAILABLE.value
504504
end
505505

506-
local function make_choice_text(data)
506+
local function make_choice_text(data, threshold)
507507
return {
508508
{width=STATUS_COL_WIDTH, text=function() return STATUS[STATUS_REVMAP[data.status]].label end},
509-
{gap=2, width=VALUE_COL_WIDTH, rjustify=true, text=common.obfuscate_value(data.value)},
509+
{gap=2, width=VALUE_COL_WIDTH, rjustify=true, text=common.obfuscate_value(data.value, threshold)},
510510
{gap=2, text=data.desc},
511511
}
512512
end
@@ -530,6 +530,7 @@ end
530530
function AssignItems:cache_choices(inside_containers, display_bld)
531531
if self.choices_cache[inside_containers] then return self.choices_cache[inside_containers] end
532532

533+
local cache_threshold = common.get_threshold(common.get_broker_skill())
533534
local choices = {}
534535
for _, item in ipairs(df.global.world.items.other.IN_PLAY) do
535536
if not is_displayable_item(item) then goto continue end
@@ -559,7 +560,7 @@ function AssignItems:cache_choices(inside_containers, display_bld)
559560
end
560561
local entry = {
561562
search_key=search_key,
562-
text=make_choice_text(data),
563+
text=make_choice_text(data, cache_threshold),
563564
data=data,
564565
}
565566
table.insert(choices, entry)

0 commit comments

Comments
 (0)