Skip to content

Commit

Permalink
prepare to be called by force (the script)
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Oct 4, 2024
1 parent 353871b commit 5e7a7a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fix/wildlife.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ local function is_active_wildlife(unit)
unit.flags2.roaming_wilderness_population_source
end

-- called by force for the "Wildlife" event
function free_all_wildlife(include_hidden)
for _,unit in ipairs(df.global.world.units.active) do
if is_active_wildlife(unit) and
(include_hidden or not dfhack.units.isHidden(unit))
then
detach_unit(unit)
end
end
end

local function unstick_surface_wildlife(opts)
local unstuck = {}
local week_ago_ticks = math.max(0, df.global.cur_year_tick - TICKS_PER_WEEK)
Expand Down

0 comments on commit 5e7a7a0

Please sign in to comment.