From aade3cf31698f60491c68729ed2a5687fe1b1d18 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 21 Apr 2025 09:38:09 -0700 Subject: [PATCH] use new assigned_unit API for 51.11 --- fix/ownership.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fix/ownership.lua b/fix/ownership.lua index c98dd42476..b3efd612bf 100644 --- a/fix/ownership.lua +++ b/fix/ownership.lua @@ -33,7 +33,7 @@ local zone_vecs = { local function relink_zones() for _,zones in ipairs(zone_vecs) do for _,zone in ipairs(zones) do - local unit = zone.assigned_unit + local unit = dfhack.buildings.getOwner(zone) if not unit then goto continue end if not utils.linear_index(unit.owned_buildings, zone.id, 'id') then print(('fix/ownership: Restoring %s ownership link for %s'):format(