Skip to content

Commit 7a18409

Browse files
authored
Merge pull request #1492 from SilasD/pedestal-fixes3
Pedestal fixes3
2 parents e2e976e + e4ac14b commit 7a18409

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Template for new versions:
4646
- `confirm`: the pause option now pauses individual confirmation types, allowing multiple different confirmations to be paused independently
4747
- `immortal-cravings`: prioritize high-value meals, properly split of portions, and don't go eating or drinking on a full stomach
4848
- `uniform-unstick`: no longer causes units to equip multiples of assigned items
49+
- `caravan`: in the pedestal item assignment dialog, add new items at the end of the list of displayed items instead of at a random position
50+
- `caravan`: in the pedestal item assignment dialog, consistently remove items from the list of displayed items
4951

5052
## Misc Improvements
5153
- `devel/hello-world`: updated to show off the new Slider widget

internal/caravan/pedestal.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,10 @@ end
599599

600600
local function unassign_item(bld, item)
601601
if not bld then return end
602-
local _, found, idx = utils.binsearch(bld.displayed_items, item.id)
603-
if found then
602+
local idx, _ = utils.linear_index(bld.displayed_items, item.id)
603+
if idx then
604604
bld.displayed_items:erase(idx)
605+
item.flags.in_building = false
605606
end
606607
end
607608

@@ -628,7 +629,7 @@ local function attach_item(item, display_bld)
628629
local ref = df.new(df.general_ref_building_display_furniturest)
629630
ref.building_id = display_bld.id
630631
item.general_refs:insert('#', ref)
631-
utils.insert_sorted(display_bld.displayed_items, item.id)
632+
display_bld.displayed_items:insert('#', item.id)
632633
item.flags.forbid = false
633634
item.flags.in_building = false
634635
end

0 commit comments

Comments
 (0)