From 74c3d8b3540cbccbab0e94ccb52248dba2ae2af2 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 25 Dec 2024 04:28:47 -0800 Subject: [PATCH 1/2] allow pets to be unassigned from cages/restraints --- docs/changelog.txt | 1 + plugins/lua/zone.lua | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 709890e662..2cdbd3b9af 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -59,6 +59,7 @@ Template for new versions: - `preserve-rooms`: don't erroneously release reservations for units that have returned from their missions but have not yet entered the fort map - `preserve-rooms`: handle case where unit records are culled by DF immediately after a unit leaves the map - `preserve-tombs`: properly re-enable after loading a game that had the tool enabled +- `zone`: assign animal to cage/restraint dialog now allows you to unassign a pet from the cage or restraint if the pet is already somehow assigned (e.g. war dog was in cage and was subsequently assigned to a dwarf) ## Misc Improvements - `strangemood`: add ability to choose Stone Cutting and Stone Carving as the mood skill diff --git a/plugins/lua/zone.lua b/plugins/lua/zone.lua index 94db5236c0..91a0cff384 100644 --- a/plugins/lua/zone.lua +++ b/plugins/lua/zone.lua @@ -798,7 +798,10 @@ function AssignAnimal:toggle_item_base(choice, target_value, bld_assignments) return target_value end - if self.initial_min_disposition ~= DISPOSITION.PET.value and choice.data.disposition == DISPOSITION.PET.value then + if self.initial_min_disposition ~= DISPOSITION.PET.value and + choice.data.disposition == DISPOSITION.PET.value and + choice.data.status ~= true_value + then return target_value end @@ -1114,7 +1117,7 @@ local CAGE_STATUS = { ASSIGNED_HERE={label='Assigned here', value=1}, PASTURED={label='In pasture', value=2}, PITTED={label='In pit/pond', value=3}, - RESTRAINED={label='On other chain', value=4}, + RESTRAINED={label='On restraint', value=4}, BUILT_CAGE={label='In built cage', value=5}, ITEM_CAGE={label='In stockpiled cage', value=6}, ROAMING={label='Roaming', value=7}, @@ -1142,9 +1145,6 @@ local function get_cage_status(unit_or_vermin, bld_assignments) end local built_chain = get_built_chain(unit_or_vermin) if built_chain then - if bld and bld == built_chain then - return CAGE_STATUS.ASSIGNED_HERE.value - end return CAGE_STATUS.RESTRAINED.value end local assigned_zone_ref = get_general_ref(unit_or_vermin, df.general_ref_type.BUILDING_CIVZONE_ASSIGNED) From 1f7ad62d5b03fa63c3fe485d07d0c9f7c3e8c46e Mon Sep 17 00:00:00 2001 From: DFHack-Urist via GitHub Actions <63161697+DFHack-Urist@users.noreply.github.com> Date: Wed, 25 Dec 2024 13:55:36 +0000 Subject: [PATCH 2/2] Auto-update submodules scripts: master --- scripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts b/scripts index 4dd7f61cfa..b0f8d4a73e 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 4dd7f61cfa14dd376e028bcd82a13cdde1dd5fcb +Subproject commit b0f8d4a73e84fd2a2e62a112850cca18fa03774e