Merge pull request #3877 from myk002/myk_dwarfveg

[dwarfvet] properly initialize job id when linking into world
develop
Myk 2023-10-14 04:23:56 -07:00 committed by GitHub
commit 02421d6825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

@ -65,6 +65,7 @@ Template for new versions:
## Fixes
- `zone`: don't show animal assignment link for cages and restraints linked to dungeon zones (which aren't normally assignable)
- `dwarfvet`: fix invalid job id assigned to ``Rest`` job, which could cause crashes on reload
## Misc Improvements
- `overlay`: allow ``overlay_onupdate_max_freq_seconds`` to be dynamically set to 0 for a burst of high-frequency updates

@ -92,13 +92,12 @@ function HospitalZone:assign_spot(unit, unit_pos)
local pos = self:find_spot(unit_pos)
if not pos then return false end
local job = df.new(df.job)
dfhack.job.linkIntoWorld(job)
dfhack.job.linkIntoWorld(job, true)
job.pos.x = pos.x
job.pos.y = pos.y
job.pos.z = pos.z
job.flags.special = true
job.job_type = df.job_type.Rest
job.wait_timer = 1600
local gref = df.new(df.general_ref_unit_workerst)
gref.unit_id = unit.id
job.general_refs:insert('#', gref)