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)