Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zone] allow pets to be unassigned from cages/restraints #5133

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions plugins/lua/zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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)
Expand Down
Loading